1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Play : MonoBehaviour {
- //int countIndex=1;
- public GameObject butPlay;
- Animator ani;
- AudioSource aud;
- public string playani;
- // Use this for initialization
- void Start () {
- ani = butPlay.GetComponent<Animator> ();
- ani.speed = 0;
- aud = butPlay.GetComponent<AudioSource> ();
- }
-
- // Update is called once per frame
- void Update () {
- if (Input.GetKeyDown(KeyCode.F)) {
-
- if(PauseSign.sign==false)
- {
- ani.speed = 1;
- ani.Play (playani, 0, 0f);
- }
- if (PauseSign.sign == true)
- {
- ani.speed = 1;
- PauseSign.sign = false;
-
- }
- }
- }
- public void onClick(){
- //countIndex *= -1;
- //if(countIndex>0){
- // ani.speed = 1;
- //}
- //if(countIndex<0){
- // ani.speed = 0;
- //}
- if(PauseSign.sign==false)
- {
- ani.speed = 1;
- ani.Play (playani, 0, 0f);
- aud.Play ();
- }
- if (PauseSign.sign == true)
- {
- ani.speed = 1;
- PauseSign.sign = false;
- aud.Pause ();
- }
- }
- }
|