public override void OnDestroy() { base.OnDestroy(); m_Context.Clear(true); m_CfgEternityProxy = null; m_Context = null; m_StateMachine = null; m_FlyerProprety = null; }
public override void OnInitialize(IFlyerProperty property) { m_FlyerProprety = property; m_CfgEternityProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy; m_Context = new DefaultContext(); m_Context.AddObject(this, true); m_Context.AddObject(typeof(IBulletTargetProperty), property, true); m_Context.AddObject(typeof(IActionFactory), TimelineActionFactory.Factory, true); m_Context.AddObject(typeof(IBaseActionProperty), property, true); m_Context.AddObject(typeof(IMoveActionProperty), property, true); ContextAddOtherObject(); m_StateMachine = new FlyerStateMachine(m_Context); m_StateMachine.CompletedHandler += OnStateMachineComplete; m_StageType = FlyerStageType.Flying; m_StateMachine.SetInitialState(FlyerStateToken.Flying); }