コード例 #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public FSMStateGoToStandingPosition()
        {
            mValidSafeHouses = new List <GameObject>(100);

            mSetActiveAnimationMsg    = new SpriteRender.SetActiveAnimationMessage();
            mSetDestinationMsg        = new PathFind.SetDestinationMessage();
            mSetSourceMsg             = new PathFind.SetSourceMessage();
            mGetCurrentBestNodeMsg    = new PathFind.GetCurrentBestNodeMessage();
            mClearDestinationMsg      = new PathFind.ClearDestinationMessage();
            mSetTargetObjectMsg       = new PathFollow.SetTargetObjectMessage();
            mSetStateMsg              = new FiniteStateMachine.SetStateMessage();
            mGetTileAtObjectMsg       = new Level.GetTileAtObjectMessage();
            mIncrementScoreMsg        = new PlayerScore.IncrementScoreMessage();
            mGetSafeHouseScoreMessage = new Behaviours.FSMCivilian.GetSafeHouseScoreMessage();
        }
コード例 #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public FSMStateFollowTarget(String animationName)
        {
            mAnimationName = animationName;

            // We need to detect when the GameObject reaches a safe house and to do so we need
            // to do a collision check against all objects of a particular classification, in this
            // case "SAFE_HOUSE".  We preallocate the two lists needed to do the check to avoid
            // triggering the GC.
            mSafeHouseInRange         = new List <GameObject>(16);
            mSafeHouseClassifications = new List <GameObjectDefinition.Classifications>();
            mSafeHouseClassifications.Add(GameObjectDefinition.Classifications.SAFE_HOUSE);

            mSetActiveAnimationMsg    = new SpriteRender.SetActiveAnimationMessage();
            mSetDestinationMsg        = new PathFind.SetDestinationMessage();
            mSetSourceMsg             = new PathFind.SetSourceMessage();
            mGetCurrentBestNodeMsg    = new PathFind.GetCurrentBestNodeMessage();
            mClearDestinationMsg      = new PathFind.ClearDestinationMessage();
            mIncrementScoreMsg        = new PlayerScore.IncrementScoreMessage();
            mSetTargetObjectMsg       = new PathFollow.SetTargetObjectMessage();
            mGetTileAtObjectMsg       = new Level.GetTileAtObjectMessage();
            mGetSafeHouseScoreMessage = new Behaviours.FSMCivilian.GetSafeHouseScoreMessage();
            mSetStateMsg = new FiniteStateMachine.SetStateMessage();
        }