Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. public class StartScene : StateMachineBehaviour {
  2.     public GameObject icon2;
  3.     public GameObject _startButton;
  4.     public void Awake()
  5.     {
  6.         icon2 = Instantiate(icon2, new Vector3(0, 0.3f, 0), Quaternion.identity) as GameObject;
  7.         _startButton = Instantiate(_startButton, new Vector3(0, -143, 0.0001012355f), Quaternion.identity) as GameObject;
  8.  
  9.     }
  10.  
  11.     public void OnStateEnter()
  12.     {
  13.         Debug.Log("Voshel v state");
  14.         _startButton.SetActive(true);
  15.         _startButton.GetComponent<Animator>().enabled = true;
  16.         _startButton.GetComponent<Animator>().Play("StartButtonAnimationEntry",0);
  17.         icon2.GetComponent<PlayableDirector>().Play();
  18.     }
  19.  
  20.     public void OnStateExit()
  21.     {
  22.         Debug.Log("Vishel iz state");
  23.         icon2.GetComponent<PlayableDirector>().Pause();
  24.         _startButton.GetComponent<Animator>().Play("StartButtonAnimationExit", 0);
  25.  
  26.  
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement