public override void OnStart()
        {
            AgentActor agent = this.Agent;

            agent.EventKey = EventType.DoorOpen;
            OffMeshLinkData currentOffMeshLinkData = agent.NavMeshAgent.get_currentOffMeshLinkData();
            DoorPoint       component1             = (DoorPoint)((Component)((OffMeshLinkData) ref currentOffMeshLinkData).get_offMeshLink()).GetComponent <DoorPoint>();

            agent.TargetInSightActionPoint = (ActionPoint)component1;
            this._actionMotion             = new PoseKeyPair()
            {
                postureID = -1,
                poseID    = -1
            };
            base.OnStart();
            if (!Object.op_Inequality((Object)agent.CurrentPoint, (Object)null))
            {
                return;
            }
            DoorAnimation component2 = (DoorAnimation)((Component)agent.CurrentPoint).GetComponent <DoorAnimation>();

            if (!Object.op_Inequality((Object)component2, (Object)null))
            {
                return;
            }
            ActionPointInfo actionPointInfo = agent.Animation.ActionPointInfo;
            PlayState       playState       = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[actionPointInfo.eventID][actionPointInfo.poseID];

            component2.Load(playState.MainStateInfo.InStateInfo.StateInfos);
            ActorAnimInfo animInfo = agent.Animation.AnimInfo;

            component2.PlayAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, playState.MainStateInfo.FadeOutTime, animInfo.layer);
        }
Esempio n. 2
0
        public override void OnStart()
        {
            this._unchangeParamState = true;
            AgentActor agent = this.Agent;

            this._prevEventKey = agent.EventKey;
            agent.EventKey     = EventType.DoorOpen;
            OffMeshLinkData currentOffMeshLinkData = agent.NavMeshAgent.get_currentOffMeshLinkData();
            DoorPoint       component1             = (DoorPoint)((Component)((OffMeshLinkData) ref currentOffMeshLinkData).get_offMeshLink()).GetComponent <DoorPoint>();

            this._prevTargetPoint = agent.TargetInSightActionPoint;
            this._isDoorOpen      = !((OffMeshLinkData) ref currentOffMeshLinkData).get_activated() || Object.op_Equality((Object)component1, (Object)null) || component1.IsOpen;
            if (this._isDoorOpen)
            {
                agent.EventKey = this._prevEventKey;
            }
            else
            {
                agent.TargetInSightActionPoint = (ActionPoint)component1;
                base.OnStart();
                if (!Object.op_Inequality((Object)agent.CurrentPoint, (Object)null))
                {
                    return;
                }
                DoorAnimation component2 = (DoorAnimation)((Component)agent.CurrentPoint).GetComponent <DoorAnimation>();
                if (!Object.op_Inequality((Object)component2, (Object)null))
                {
                    return;
                }
                ActionPointInfo actionPointInfo = agent.Animation.ActionPointInfo;
                PlayState       playState       = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[actionPointInfo.eventID][actionPointInfo.poseID];
                component2.Load(playState.MainStateInfo.InStateInfo.StateInfos);
                ActorAnimInfo animInfo = agent.Animation.AnimInfo;
                component2.PlayAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, playState.MainStateInfo.FadeOutTime, animInfo.layer);
            }
        }