示例#1
0
 void Start()
 {
     riderCombat     = GetComponentInChildren <RiderCombat>();
     animalAIControl = GetComponentInChildren <MAnimalAIControl>();
     mAnimal         = GetComponentInChildren <MAnimal>();
     rider           = GetComponentInChildren <MRider>();
     //animalAIControl.enabled = false;
     //  SetClosestWaypoint();
 }
示例#2
0
        [HideInInspector] public float[] DecisionsTime;// { get; set; }

        #endregion


        void Awake()
        {
            if (AIMovement == null)
            {
                AIMovement = Animal.FindComponent <MAnimalAIControl>();
            }
            var AnimalStatscomponent = Animal.FindComponent <Stats>();

            if (AnimalStatscomponent)
            {
                AnimalStats = AnimalStatscomponent.stats_D;
            }

            AgentHeight = transform.lossyScale.y * AIMovement.Agent.height;
        }
示例#3
0
        void Reset()
        {
            remainInState = MTools.GetInstance <MAIState>("Remain in State");
            AIMovement    = this.FindComponent <MAnimalAIControl>();

            if (AIMovement)
            {
                //AIMovement.AutoInteract = false;
                AIMovement.AutoNextTarget          = false;
                AIMovement.UpdateTargetPosition    = false;
                AIMovement.MoveAgentOnMovingTarget = false;
                AIMovement.LookAtTargetOnArrival   = false;

                if (Animal)
                {
                    Animal.isPlayer.Value = false;         //Make sure this animal is not the Main Player
                }
            }
            else
            {
                Debug.LogWarning("There's AI Control in this GameObject");
            }
        }