protected override void OnShow(object userData) { base.OnShow(userData); m_BirdData = (BirdData)userData; //修改缩放 CachedTransform.localScale = Vector2.one * 2; if (m_Rigidbody == null) { m_Rigidbody = GetComponent <Rigidbody2D>(); } //重置射击冷却 m_ShootTimer = 10f; }
protected override void OnShow(object userData) { base.OnShow(userData); m_BirdData = (BirdData)userData; CachedTransform.localScale = Vector2.one * 2; if (m_Rigibody2D == null) { m_Rigibody2D = GetComponent <Rigidbody2D>(); } m_ShootTimer = 1f; m_IsDead = false; }
/// <summary> /// 显示小鸟实体 /// </summary> public static void ShowBird(this EntityComponent entityComponent, BirdData data) { entityComponent.ShowEntity(typeof(Bird), "Bird", data); }
public static void ShowBird(this EntityComponent entityComponent, BirdData data) { entityComponent.ShowEntity(typeof(Bird), "Bird", Constant.AssetPriority.BirdAsset, data); }