private void Awake() { beatManager = GetComponent <BeatManager>(); audioManager = GetComponent <AudioManager>(); energyIcon = transform.GetComponentInChildren <EnergyIcon>(); EnergyIcon.OnEnergyStateChange += OnEnergyStateChange; EnergyIcon.OnFireClick += onfireClick; BeatManager.OnCorrectClick += OnCorrectClick; BeatManager.OnWrongClick += OnWrongClick; BeatManager.OnMissClick += OnMissClick; BeatManager.OnLevelCompleted += OnLevelCompleted; BeatManager.OnGroupCompleted += OnGroupCompleted; levelList[0] = level1; levelList[1] = level2; levelList[2] = level3; levelList[3] = level4; catAnimator = GameObject.FindGameObjectWithTag("Cat").GetComponent <Animator>(); fogueiraAnimator = GameObject.FindGameObjectWithTag("Fogueira").GetComponent <Animator>(); girlAnimator = GameObject.FindGameObjectWithTag("Girl").GetComponent <Animator>(); }
private IEnumerator AnimateIcon(EnergyIcon icon, Vector3 newpos) { float i = 0f; while (i < 1f) { i += Time.deltaTime / this.m_IconScroller.ANIM_TIME; icon.m_IconTransform.localPosition = Vector3.Lerp(icon.m_IconTransform.localPosition, newpos, i); yield return(null); } icon.m_IconTransform.localPosition = newpos; yield break; }
public void Awake() { Instance = this; }