/// <summary> /// 播放动画 /// </summary> /// <param name="animName">Animation name.</param> /// <param name="loop">If set to <c>true</c> loop.</param> public override void playAnim(string animName, bool loop = false) { base.playAnim(animName, loop); SpriteEvent sprite = getEventSprite(); sprite.playAnim(animName, loop); }
/// <summary> /// 读档初始化精灵 /// </summary> public void loadInitSprite() { SpriteEvent sprite = getEventSprite(); foreach (EventPage page in sprite.GetComponentsInChildren <EventPage>(true)) { page.transform.GetComponent <SpriteRenderer>().color = new Color(0, 0, 0, 0); page.gameObject.SetActive(false); } // 恢复循环动画 foreach (string animName in this.loopAnimNames) { sprite.playAnim(animName, true); } }