protected void OnShowEntitySuccess(object sender, GameEventArgs e) { ShowEntitySuccessEventArgs ne = (ShowEntitySuccessEventArgs)e; if (ne.EntityLogicType == typeof(DemoSF_Aircraft)) { m_MyAircraft = (DemoSF_Aircraft)ne.Entity.Logic; } }
public void Initialize() { DemoSF_GameEntry.Event.Subscribe(ShowEntitySuccessEventArgs.EventId, OnShowEntitySuccess); DemoSF_GameEntry.Event.Subscribe(ShowEntityFailureEventArgs.EventId, OnShowEntityFailure); m_SceneBackground = Object.FindObjectOfType <DemoSF_ScrollableBackground>(); // 创建实体 DemoSF_GameEntry.Entity.ShowEntity <DemoSF_Aircraft>( DemoSF_EntityExtension.GenerateSerialId(), "Assets/DemoStarForce/Prefabs/PlayerShip.prefab", "PlayerGroup"); GameOver = false; m_MyAircraft = null; }