Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class CrossAnimate : MonoBehaviour {
- public GameObject UpCurs;
- public GameObject DownCurs;
- public GameObject LeftCurs;
- public GameObject RightCurs;
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- if (Input.GetMouseButtonDown(0))
- {
- UpCurs.GetComponent<Animator>().enabled = true;
- DownCurs.GetComponent<Animator>().enabled = true;
- LeftCurs.GetComponent<Animator>().enabled = true;
- RightCurs.GetComponent<Animator>().enabled = true;
- WaitingAnim();
- }
- }
- IEnumerator WaitingAnim()
- {
- yield return new WaitForSeconds(1f);
- UpCurs.GetComponent<Animator>().enabled = false;
- DownCurs.GetComponent<Animator>().enabled = false;
- LeftCurs.GetComponent<Animator>().enabled = false;
- RightCurs.GetComponent<Animator>().enabled = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement