Exemple #1
0
        public void Awake()
        {
            Prototype = AiPrototype.ExtractPrototypeInfo(this);

            Mind       = MindImpl();
            Mind.AiRig = this;

            //Movement
            Movement = MoveImpl();


            //Vision Setup
            GameObject vision         = CreateContainer("Vision");
            var        visionCollider = vision.AddComponent <SphereCollider>();

            vision.AddComponent <Rigidbody>()
            .isKinematic          = true;
            VisionSensor          = vision.AddComponent <VisionSense>();
            VisionSensor.Collider = visionCollider;
            VisionSensor.Mind     = Mind;

            //Audio Setup
            GameObject audio         = CreateContainer("Audio");
            var        audioCollider = audio.AddComponent <SphereCollider>();

            audio.AddComponent <Rigidbody>()
            .isKinematic         = true;
            AudioSensor          = audio.AddComponent <AudiatorySense>();
            AudioSensor.Collider = audioCollider;
            AudioSensor.Mind     = Mind;

            //Scent Setup
            GameObject smell         = CreateContainer("Scent");
            var        scentCollider = smell.AddComponent <SphereCollider>();

            smell.AddComponent <Rigidbody>()
            .isKinematic         = true;
            ScentSensor          = smell.AddComponent <ScentSense>();
            ScentSensor.Collider = scentCollider;
            ScentSensor.Mind     = Mind;

            //Ranking between AI's
            RankingSystem = RankingImpl();
        }
Exemple #2
0
        public void Awake()
        {
            Prototype = AiPrototype.ExtractPrototypeInfo(this);

            Mind = MindImpl();
            Mind.AiRig = this;

            //Movement
            Movement = MoveImpl();

            //Vision Setup
            GameObject vision = CreateContainer("Vision");
            var visionCollider = vision.AddComponent<SphereCollider>();
            vision.AddComponent<Rigidbody>()
                  .isKinematic = true;
            VisionSensor = vision.AddComponent<VisionSense>();
            VisionSensor.Collider = visionCollider;
            VisionSensor.Mind = Mind;

            //Audio Setup
            GameObject audio = CreateContainer("Audio");
            var audioCollider = audio.AddComponent<SphereCollider>();
            audio.AddComponent<Rigidbody>()
                 .isKinematic = true;
            AudioSensor = audio.AddComponent<AudiatorySense>();
            AudioSensor.Collider = audioCollider;
            AudioSensor.Mind = Mind;

            //Scent Setup
            GameObject smell = CreateContainer("Scent");
            var scentCollider = smell.AddComponent<SphereCollider>();
            smell.AddComponent<Rigidbody>()
                  .isKinematic = true;
            ScentSensor = smell.AddComponent<ScentSense>();
            ScentSensor.Collider = scentCollider;
            ScentSensor.Mind = Mind;

            //Ranking between AI's
            RankingSystem = RankingImpl();
        }