Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class StartScene : StateMachineBehaviour {
- public GameObject icon2;
- public GameObject _startButton;
- public void Awake()
- {
- icon2 = Instantiate(icon2, new Vector3(0, 0.3f, 0), Quaternion.identity) as GameObject;
- _startButton = Instantiate(_startButton, new Vector3(0, -143, 0.0001012355f), Quaternion.identity) as GameObject;
- }
- public void OnStateEnter()
- {
- Debug.Log("Voshel v state");
- _startButton.SetActive(true);
- _startButton.GetComponent<Animator>().enabled = true;
- _startButton.GetComponent<Animator>().Play("StartButtonAnimationEntry",0);
- icon2.GetComponent<PlayableDirector>().Play();
- }
- public void OnStateExit()
- {
- Debug.Log("Vishel iz state");
- icon2.GetComponent<PlayableDirector>().Pause();
- _startButton.GetComponent<Animator>().Play("StartButtonAnimationExit", 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement