コード例 #1
0
        public override void Init()
        {
            base.Init();
            InfluenceMapTrigger tInfluenceMapTrigger = new InfluenceMapTrigger();

            tInfluenceMapTrigger.maxInfluence = 0.0f;
            tInfluenceMapTrigger.mWhere       = "Collision";
            tInfluenceMapTrigger.mGameObject  = mGameObject;
            tInfluenceMapTrigger.mIMComputer  = DefaultFunc.ObastecleComputer;

            tInfluenceMapTrigger.Init();
            this.AddComponent <InfluenceMapTrigger> (tInfluenceMapTrigger);
        }
コード例 #2
0
        /*
         *
         * add the must component to AIEntity
         *
         */

        public override void Init()
        {
            BaseAIComponent tBAIComponent = new BaseAIComponent();

            tBAIComponent.mAITemplate = mAI;
            tBAIComponent.bornPoint   = AIPos;
            tBAIComponent.Init();
            AIMove            mAIMove            = new AIMove();
            AIAnimation       mAIAnimation       = new AIAnimation();
            HPComponent       hpc                = new HPComponent();
            AIState           aiState            = new AIState();
            AIEmotion         mEmotion           = new AIEmotion();
            AIStrategy        mAIStrategy        = new AIStrategy();
            ObstacleComponent mObstacleComponent = new ObstacleComponent();
            AIGroupState      aiGroupState       = new AIGroupState();

            this.AddComponent <BaseAIComponent> (tBAIComponent);
            this.AddComponent <AIMove> (mAIMove);
            this.AddComponent <AIAnimation> (mAIAnimation);
            this.AddComponent <HPComponent> (hpc);
            this.AddComponent <AIState> (aiState);
            this.AddComponent <AIEmotion> (mEmotion);
            this.AddComponent <AIStrategy> (mAIStrategy);
            this.AddComponent <ObstacleComponent> (mObstacleComponent);
            this.AddComponent <AIGroupState> (aiGroupState);
            this.AddComponent <LODComponent> (new LODComponent());

            mAIStrategy.Init();
            aiGroupState.Init();
            aiState.Init();
            mAIAnimation.Init();
            mEmotion.Init();

            InfluenceMapTrigger tInfluenceMapTrigger = new InfluenceMapTrigger();

            tInfluenceMapTrigger.maxInfluence = 4.0f;
            tInfluenceMapTrigger.mWhere       = "friend";
            tInfluenceMapTrigger.mGameObject  = mAI;
            tInfluenceMapTrigger.mIMComputer  = DefaultFunc.friendComputer;
            tInfluenceMapTrigger.Init();

            UEntity tEntity = new UEntity();

            tEntity.AddComponent <InfluenceMapTrigger> (tInfluenceMapTrigger);
            this.mWorld.registerEntityAfterInit(tEntity);
            AIEntity.getList().Add(this);
        }