Ejemplo n.º 1
0
        /// <summary>
        /// 切换状态到 EndStage
        /// </summary>
        /// <param name="obj"></param>
        public void DoEnd(IComponentEvent obj)
        {
            FlyerTriggerToEnitity trigger = obj as FlyerTriggerToEnitity;

            Leyoutech.Utility.DebugUtility.LogWarning("子弹", string.Format("DoEnd --> 碰撞到单位了 who = {0}", trigger.targetEntity));
            StageType = FlyerStageType.End;
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        protected void SetStageType(FlyerStageType stageType)
        {
            FlyerActionComponent flyerComponent = Context.GetObject <FlyerActionComponent>();

            flyerComponent.StageType = stageType;
        }