// Use this for initialization
 void Start()
 {
     npc = GetComponentInChildren<AIRig>();
     p_systems = GetComponentsInChildren<ParticleSystem>();
     player_animator = GetComponent<Animator>();
     dizzy = GetComponent<AudioSource>();
 }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     enemigoControlador = GetComponent <CharacterController> ();
     salud         = GetComponent <health>();
     moveVector    = Vector3.zero;
     _componenteIA = GetComponentInChildren <AIRig> ();
 }
Esempio n. 3
0
    // accesseur pour savoir si le musicien est en train de danser
    public bool IsTheMusicianDancing()
    {
        AIRig aiRig = sceneLeader.GetComponentInChildren <AIRig>();

        RAIN.Memory.BasicMemory tMusicianMemory = aiRig.AI.WorkingMemory as RAIN.Memory.BasicMemory;
        return(tMusicianMemory.GetItem <bool>("isDancing"));
    }
Esempio n. 4
0
    // Use this for initialization
    void Start()
    {
        AIRig rig = GetComponentInChildren <AIRig>();

        lichAi    = rig.AI;
        timeTaken = 0;
    }
 new void Start()
 {
     base.Start();
     LunaBlastTimer = 0f;
     ai = gameObject.GetComponentInChildren<AIRig>();
     if (ai == null) Debug.Log("AIRig not found in " + this);
 }
Esempio n. 6
0
    void Awake()
    {
        AIRig aiRig = GetComponentInChildren <AIRig>();

        tMemory = aiRig.AI.WorkingMemory as RAIN.Memory.BasicMemory;
        tSens   = aiRig.AI.Senses as RAIN.Perception.BasicSenses;
    }
Esempio n. 7
0
    void Start()
    {
        moveLocked = hatarakeLocked = true;

        AIRig aiRig = GetComponentInChildren <AIRig>();

        tMemory = aiRig.AI.WorkingMemory as RAIN.Memory.BasicMemory;
        tMotor  = aiRig.AI.Motor as RAIN.Motion.MecanimMotor;

        /*
         * moveLocked = true;
         * hatarakeLocked = true;*/

        foreach (Transform go in transform)
        {
            if (go.name == "Cylinder")
            {
                actionArea = go;
            }
        }

        tNav = aiRig.AI.Navigator as RAIN.Navigation.BasicNavigator;

        //navComponent = this.transform.GetComponent <NavMeshAgent>();
    }
Esempio n. 8
0
    void Awake()
    {
        AIRig aiRig = GetComponentInChildren <AIRig>();

        tMemory = aiRig.AI.WorkingMemory as RAIN.Memory.BasicMemory;
        tNav    = aiRig.AI.Navigator as RAIN.Navigation.BasicNavigator;
    }
Esempio n. 9
0
 void Awake()
 {
     // Set up the reference.
     anim   = GetComponent <Animator> ();
     aiRig1 = NPC1.GetComponentInChildren <AIRig> ();
     aiRig2 = NPC2.GetComponentInChildren <AIRig> ();
     aiRig3 = NPC3.GetComponentInChildren <AIRig> ();
 }
Esempio n. 10
0
 // Use this for initialization
 void Start()
 {
     _vida        = GetComponent <Vida> ();
     vidaTemporal = _vida.vida;
     _animator    = GetComponent <Animator> ();
     _controler   = GetComponent <CharacterController> ();
     _airing      = GetComponentInChildren <AIRig> ();
 }
Esempio n. 11
0
    // Use this for initialization
    void Start()
    {
        audioEventName = defaultAudioEventName;
        AIRig aiRig = GetComponentInChildren <AIRig>();

        tMemory      = aiRig.AI.WorkingMemory as RAIN.Memory.BasicMemory;   // récupération des composants RAIN
        endWaitTimer = (int)Random.Range(minEndWaitTimer, maxEndWaitTimer); // séléction aléatoire de la fin du timer d'attente
    }
	// Use this for initialization
	void Start () 
	{
		anim = GetComponent<Animator>();
		ai = GetComponentInChildren<AIRig>();
		col = GetComponent<CapsuleCollider>();
		startingHealth = Health;
		playerEnergy = GameObject.Find("Player").GetComponent<RobotEnergy>();
	}
Esempio n. 13
0
 // Use this for initialization
 void Start()
 {
     _animator      = GetComponent <Animator> ();
     _healthScript  = GetComponent <Health> ();
     _controller    = GetComponent <CharacterController> ();
     _aiRig         = GetComponentInChildren <AIRig> ();
     previousHealth = _healthScript.health;
 }
Esempio n. 14
0
 void Awake()
 {
     // Set up the reference.
         anim = GetComponent <Animator> ();
         aiRig1 = NPC1.GetComponentInChildren<AIRig> ();
         aiRig2 = NPC2.GetComponentInChildren<AIRig> ();
         //aiRig3 = NPC3.GetComponentInChildren<AIRig> ();
 }
Esempio n. 15
0
    // Use this for initialization
    void Start()
    {
        //obtenemos el componente animator
        _animator = GetComponent<Animator>();
        //obtenemos el componente rigidbody
        _rigidbody = GetComponent<Rigidbody>();

        _ai = GetComponentInChildren<AIRig>();
    }
Esempio n. 16
0
    void Start()
    {
        AIRig aiRig = GetComponentInChildren <AIRig>();                  // récupération du composant RAIN

        tMemory = aiRig.AI.WorkingMemory as RAIN.Memory.BasicMemory;     // récupération de la mémoire RAIN
        startingFragment.GetComponent <levitation>().IsHeld(true);       // désactivation de la lévitation du fragment avec lequel le guide commence
        startingFragment.GetComponent <InteractibleObject> ().OnTouch(); //rammassage du fragment de départ du guide
        PickUpObject(startingFragment);                                  //idem
    }
Esempio n. 17
0
    // Use this for initialization
    void Start()
    {
        //obtenemos el componente animator
        _animator = GetComponent <Animator>();
        //obtenemos el componente rigidbody
        _rigidbody = GetComponent <Rigidbody>();

        _ai = GetComponentInChildren <AIRig>();
    }
Esempio n. 18
0
    // Use this for initialization
    void Start()
    {
        zombieAiRig = gameObject.GetComponentInChildren <AIRig>();
        zombieAi    = zombieAiRig.AI;

        trees  = GameObject.Find("GameManager").GetComponent <GameManager>().trees;
        graves = GameObject.Find("GameManager").GetComponent <GameManager>().graves;
        SetTreeTarget(RandomTree());
        SetGraveTarget(RandomGrave());
    }
Esempio n. 19
0
    void Start()
    {
        goalCenter = (leftPost.position - rightPost.position)/2 + rightPost.position;
        Debug.Log("Goal center z = " + goalCenter.z);
        goalieRig = GetComponentInChildren<AIRig>();
        goalieRig.AI.WorkingMemory.SetItem<Vector3>("GoalCenter", goalCenter);

        soccerBall = FindObjectOfType<SoccerBall>();
        goalieRig.AI.WorkingMemory.SetItem<Vector3>("SoccerBallPos", soccerBall.transform.position);
    }
Esempio n. 20
0
    // Use this for initialization
    void Start()
    {
        isTail = true;
        isHead = false;
        rear   = transform.forward * -1;

        AIRig aiComponent = gameObject.GetComponentInChildren <AIRig>();

        aiClass = aiComponent.AI;
    }
Esempio n. 21
0
    void Start()
    {
        goalCenter = (leftPost.position - rightPost.position) / 2 + rightPost.position;
        Debug.Log("Goal center z = " + goalCenter.z);
        goalieRig = GetComponentInChildren <AIRig>();
        goalieRig.AI.WorkingMemory.SetItem <Vector3>("GoalCenter", goalCenter);

        soccerBall = FindObjectOfType <SoccerBall>();
        goalieRig.AI.WorkingMemory.SetItem <Vector3>("SoccerBallPos", soccerBall.transform.position);
    }
Esempio n. 22
0
    // Use this for initialization
    public void Start()
    {
        AIRig aiRig = GetComponentInChildren <AIRig>();

        tMemory = aiRig.AI.WorkingMemory as RAIN.Memory.BasicMemory; // référence sur mémoire RAIN


        endSoundTimer = (int)Random.Range(minEndSoundTimer, maxEndSoundTimer); // initialisation aléatoire de timer
        endWaitTimer  = (int)Random.Range(minEndWaitTimer, maxEndWaitTimer);
    }
Esempio n. 23
0
 // Use this for initialization
 public void Start()
 {
     if (gameObject.name == "Dude")
     {
         StartCoroutine("Chasing");
     }
     aus   = GetComponent <AudioSource>();
     anim  = GetComponent <Animator>();
     aiRig = GetComponentInChildren <AIRig>();
     rb    = GetComponent <Rigidbody>();
 }
Esempio n. 24
0
    // Use this for initialization
    void Start()
    {
        InitStats();
        InitStartingTable();
        BuildStats();

        gm = GameObject.Find("GameManager").GetComponent <GameManager>();

        ghoulAIRig = gameObject.GetComponentInChildren <AIRig>();
        ghoulAI    = ghoulAIRig.AI;
    }
Esempio n. 25
0
    // Use this for initialization
    void Start()
    {
        npc = GetComponentInChildren<AIRig>();
        p_systems = GetComponentsInChildren<ParticleSystem>();
        player_animator = GetComponent<Animator>();
        dizzy = GetComponent<AudioSource>();
        guard_location = GetComponent<Transform>();
        npc.AI.Mind.AI.WorkingMemory.SetItem<Vector3>("initial_location", guard_location.position);

        switches = GameObject.FindGameObjectsWithTag("Switch");
    }
Esempio n. 26
0
 public void RemoveEnemy(GameObject e)
 {
     if (enemiesList.Contains(e))
     {
         enemiesList.Remove(e);
         AIRig aiR = e.GetComponent <AIRig>();
         if (closeList.Contains(aiR))
         {
             closeList.Remove(aiR);
         }
     }
 }
    public override ActionResult Execute(RAIN.Core.AI ai)
    {
        Miner theMiner = ai.Body.GetComponent <Miner>();

        theMiner.MinerLocation = Miner.Location.Home;
        theMiner.MinerState    = Miner.State.GoHomeAndSleep;
        AIRig minerRig = theMiner.GetComponentInChildren <AIRig>();

        minerRig.AI.WorkingMemory.SetItem <int>("MinerState", 2);
        //minerRig.AI.WorkingMemory.SetItem<Miner.Location>("MinerLocation", Miner.Location.Home);
        return(ActionResult.SUCCESS);
    }
Esempio n. 28
0
    // Use this for initialization
    void Start()
    {
        base.Start();

        Gob = this.GetComponent <GoblinAI>();
        ai  = this.GetComponentInChildren <AIRig>();

        if (playerUW == null)
        {
            playerUW = GameObject.Find("Gronk").GetComponent <UWCharacter>();
        }
        //playerUW = GameObject.Find ("Gronk").GetComponent<UWCharacter>();
        ai.AI.WorkingMemory.SetItem <GameObject>("playerUW", playerUW.gameObject);
        ai.AI.Body = this.gameObject;
    }
Esempio n. 29
0
 void deductHealth(Collider col)
 {
     if (healthManager = col.GetComponent<Health>()){
         healthManager.takeDamage(20f);
     }
     else if (NPCStats = col.GetComponent(typeof(F_Stats)) as F_Stats){
         NPCStats.takeDamage(20f);
     }
     else if (tRig = col.rigidbody.GetComponentInChildren<AIRig>())
         {
             Debug.Log (tRig);
             float currentHelath = tRig.AI.WorkingMemory.GetItem<float>("health");
             tRig.AI.WorkingMemory.SetItem<float>("health", currentHelath - 20f);
         }
 }
Esempio n. 30
0
    // Token: 0x060059EF RID: 23023 RVA: 0x001F3C1C File Offset: 0x001F201C
    public void Initialize(VRC_DataStorage data)
    {
        this.dataStorage = data;
        this._animator   = base.GetComponentInChildren <Animator>();
        AIRig componentInChildren = base.GetComponentInChildren <AIRig>();

        if (componentInChildren != null)
        {
            this._rainMemory = componentInChildren.AI.WorkingMemory;
        }
        if (VRC_DataStorageInternal.f__mg0 == null)
        {
            VRC_DataStorageInternal.f__mg0 = new Func <VRC_DataStorage, string, int>(VRC_DataStorageInternal.GetElementIndex);
        }
        VRC_DataStorage._GetElementIndex = VRC_DataStorageInternal.f__mg0;
    }
Esempio n. 31
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag.Equals("Enemy"))        // BETA EnemySphereCollider
        {
            //http://support.rivaltheory.com/vanilla/index.php?p=/discussion/comment/1447#Comment_1447
            //http://support.rivaltheory.com/vanilla/index.php?p=/discussion/468/how-to-stop-a-moveto-operation-if-the-target-gameobject-is-destroyed/p1

            // Remove Rain indie components
            Destroy(gameObject.GetComponent("Decoration"));
            Destroy(gameObject.GetComponent("Entity"));

            // Reset the senses of the AI, after Decoration en Entity are removed
            // to make shure the AI agent isn't holding a lock on the object
            //RAINAgent ai = other.transform.parent.gameObject.GetComponent<RAINAgent>();
            AIRig ai = other.transform.Find("AI").GetComponent <AIRig>();            // updated to new RAIN indy

            // add Ammo to the AI character
            //ai.Agent.actionContext.SetContextItem<int>("ammo", ammo);
            ai.AI.WorkingMemory.SetItem <int>("ammo", ammo);            // updated to new RAIN indy


            // destroy the game object after 0.2f seconds, zo the AI is done refreshing senses
            StartCoroutine(WaitAndDestroy(0.3f));
        }



        if (other.tag.Equals("PlayerKartModel"))
        {
            //http://support.rivaltheory.com/vanilla/index.php?p=/discussion/comment/1447#Comment_1447
            //http://support.rivaltheory.com/vanilla/index.php?p=/discussion/468/how-to-stop-a-moveto-operation-if-the-target-gameobject-is-destroyed/p1

            // Remove Rain indie components
            Destroy(gameObject.GetComponent("Decoration"));
            Destroy(gameObject.GetComponent("Entity"));

            // Reset the senses of the AI, after Decoration en Entity are removed
            // to make shure the AI agent isn't holding a lock on the object
            //	RAINAgent ai = GameObject.FindGameObjectWithTag("Enemy").GetComponent<RAINAgent>();
            //	AIRig ai = GameObject.FindGameObjectWithTag("Enemy").GetComponent<AIRig>();


            // destroy the game object after 0.2f seconds, zo the AI is done refreshing senses
            StartCoroutine(WaitAndDestroy(0.3f));
        }
    }
Esempio n. 32
0
    // Start
    void Start()
    {
        // Cached components
        aiRig       = GetComponentInChildren <AIRig>();
        aiMemory    = aiRig.AI.WorkingMemory;
        aiMotor     = aiRig.AI.Motor;
        aiNavigator = (BasicNavigator)aiRig.AI.Navigator;

        // Sensors
        sensors      = new List <RAIN.Perception.Sensors.RAINSensor>(aiRig.AI.Senses.Sensors);
        visualSensor = aiRig.AI.Senses.GetSensor("Visual Sensor");
        audioSensor  = aiRig.AI.Senses.GetSensor("Audio Sensor");

        // Repeated calls
        InvokeRepeating("SendToClients", 0.001f, 1.0f / uLink.Network.sendRate);
        InvokeRepeating("React", 0.001f, Config.instance.enemyReactionTime);
    }
Esempio n. 33
0
    void Update()
    {
        if (aiRig == null)
        {
            aiRig = gameObject.GetComponentInChildren <AIRig>();
        }
        if (aiRig != null)
        {
            aiRig.AI.WorkingMemory.SetItem("health", health);
        }

        if (fademusicintenstiy && isPlayer)
        {
        }
        if (rampmusicintenstiy && isPlayer)
        {
        }
    }
Esempio n. 34
0
    public override ActionResult Execute(RAIN.Core.AI ai)
    {
        GameObject mob = ai.WorkingMemory.GetItem <GameObject>("mob");

        ai.Senses.GetSensor("SlowZoneSensor").MatchAspectName("aMob");

        IList <RAIN.Entities.Aspects.RAINAspect> list = ai.Senses.GetSensor("SlowZoneSensor").Matches;

        foreach (RAIN.Entities.Aspects.RAINAspect it in list)
        {
            AIRig aiMob = it.MountPoint.GetComponentsInChildren <AIRig>()[0];
            aiMob.AI.Motor.DefaultSpeed = 2;

            //Transform aiMob = (Transform)it.MountPoint;
        }

        return(ActionResult.SUCCESS);
    }
    public override ActionResult Execute(RAIN.Core.AI ai)
    {
        Miner theMiner = ai.Body.GetComponent <Miner>();

        theMiner.MinerLocation = Miner.Location.Bank;
        theMiner.MinerState    = Miner.State.VisitBank;
        AIRig minerRig = theMiner.GetComponentInChildren <AIRig>();

        minerRig.AI.WorkingMemory.SetItem <int>("MinerState", 1);

        /*
         * theMiner.Wealth += theMiner.Gold;
         * theMiner.Gold = 0;
         * minerRig.AI.WorkingMemory.SetItem<int>("Wealth", theMiner.Wealth);
         * minerRig.AI.WorkingMemory.SetItem<int>("Gold", theMiner.Gold);
         */
        //minerRig.AI.WorkingMemory.SetItem<Miner.Location>("MinerLocation", Miner.Location.Bank);
        return(ActionResult.SUCCESS);
    }
Esempio n. 36
0
    // Update is called once per frame
    void Update()
    {
        tempReloadTime -= 10.0f * Time.deltaTime;

        if (tempReloadTime < 0.0f)
        {
            // Get all human players
            GameObject[] players = GameObject.FindGameObjectsWithTag("Player");

            //RAINAgent ai = gameObject.GetComponent<RAINAgent>();
            AIRig ai = gameObject.transform.Find("AI").GetComponent <AIRig>();


            foreach (GameObject player in players)
            {
                var targetDir = player.transform.position - _transform.position;
                var forward   = _transform.forward;
                var angle     = Vector3.Angle(targetDir, forward);

                // Get ammo count from AI
                //	int ammo = ai.Agent.actionContext.GetContextItem<int>("ammo");
                int ammo = ai.AI.WorkingMemory.GetItem <int>("ammo");


                if (angle < enemyShootAngle && ammo > 0)
                {
                    GameObject bullet     = PhotonNetwork.Instantiate("BomfabEnemy", _transform.position + (spawnDistanceForward * _transform.forward) + (spawnDistanceUp * _transform.up), _transform.rotation, 0);
                    BulletAi   controller = bullet.GetComponent <BulletAi>();
                    controller.enabled = true;

                    tempReloadTime = reloadTime;

                    //	Debug.Log( "AI ammo " + ammo);
                    // Set ammo count to AI
                    //	ai.Agent.actionContext.SetContextItem<int>("ammo", ammo-1);
                    ai.AI.WorkingMemory.SetItem <int>("ammo", ammo - 1);
                }
            }
        }
    }
Esempio n. 37
0
 public void SelectRandomCloseRange()
 {
     if (closeList.Count < numberEnemiesClose)
     {
         int emptyCells         = numberEnemiesClose - closeList.Count;
         List <GameObject> temp = enemiesList;
         int closeListCount     = closeList.Count;
         int ceil = Mathf.Min(numberEnemiesClose, temp.Count);
         for (int i = closeListCount; i < ceil; i++)
         {
             int   rand    = Random.Range(0, enemiesList.Count);
             AIRig aiToAdd = temp[rand].GetComponentInChildren <AIRig>();
             if (!closeList.Contains(aiToAdd))
             {
                 closeList.Add(enemiesList[rand].GetComponentInChildren <AIRig>());
                 closeList[i].AI.WorkingMemory.SetItem <bool>("CloseRange", true);
                 closeList[i].AI.WorkingMemory.SetItem <float>("MaxDistance", 3.5f);
             }
             temp.Remove(temp[rand]);
         }
     }
 }
Esempio n. 38
0
    // Use this for initialization
    void Awake()
    {
        minerRig = GetComponentInChildren<AIRig>();
        // Set the miner's state and behavior to be accessible in the behavior tree
        minerRig.AI.WorkingMemory.SetItem<int>("MinerState", 0);
        //minerRig.AI.WorkingMemory.SetItem<Miner.Location>("MinerLocation", Location.Mine);
        // Set the miner's thresholds to be visible in the behavior tree
        minerRig.AI.WorkingMemory.SetItem<int>("ComfortLevel", comfortLevel);
        minerRig.AI.WorkingMemory.SetItem<int>("ThirstThreshold", thirstThreshold);
        minerRig.AI.WorkingMemory.SetItem<int>("GoldThreshold", goldThreshold);
        // Set the initial values of the miner's variables to be seen in the behavior tree
        minerRig.AI.WorkingMemory.SetItem<int>("Fatigue", fatigue);
        minerRig.AI.WorkingMemory.SetItem<int>("Gold", gold);
        minerRig.AI.WorkingMemory.SetItem<int>("Thirst", thirst);
        minerRig.AI.WorkingMemory.SetItem<int>("Wealth", wealth);

        Debug.Log(
          ", GoldMAX " + minerRig.AI.WorkingMemory.GetItem<int>("GoldThreshold") +
          ", ThirstMAX " + minerRig.AI.WorkingMemory.GetItem<int>("ThirstThreshold") +
          ", WealthMAX " + minerRig.AI.WorkingMemory.GetItem<int>("ComfortLevel"));

        StartCoroutine(Thinker());
    }
Esempio n. 39
0
 // Use this for initialization
 void Start()
 {
     myAI = this.GetComponentInChildren<AIRig>();
     if(myAI==null)
         Debug.Log("You need to add an AI Component!",this.gameObject);
     myFormationHarnessElement = myAI.AI.GetCustomElement<FormationHarnessElement>();
     if(displayText!=null)
         displayText.text=
             "FORMATION TYPE:\n"+
             wedge+" - Wedge Formation\n"+
             column+" - Column Formation\n"+
             skirmishLeft+" - Skirmish Left Formation\n"+
             skirmishRight+" - Skirmish Right Formation\n"+
             echelonLeft+" - Echelon Left Formation\n"+
             echelonRight+" - Echelon Right Formation\n"+
             "\n"+
             "SQUAD COMMANDS\n"+
             formUp+" - Squad Form Up\n"+
             attack+" - Squad Attack\n"+
             coverMe+" - Squad Cover Me\n"+
             takeCover+" - Squad Take Cover\n"+
             flank+" - Squad Flank\n";
 }
Esempio n. 40
0
    void Awake()
    {
        // Set up the reference.
            anim = GetComponent <Animator> ();
            aiRig1 = NPC1.GetComponentInChildren<AIRig> ();
            aiRig2 = NPC2.GetComponentInChildren<AIRig> ();
            //aiRig3 = NPC3.GetComponentInChildren<AIRig> ();

        winBox = GameObject.Find("Win Box");

        p_systems = winBox.GetComponentsInChildren<ParticleSystem>();

        Debug.Log(p_systems[0].name);

        //			for (int i = 0; i < p_systems.Length; i++)
        //			{
        //				if (p_systems[i].name == "Fireworks")
        //				{
        //
        //				p_systems[i].enableEmission = false;
        //				}
        //			}
    }
Esempio n. 41
0
    // Use this for initialization
    void Awake()
    {
        minerRig = GetComponentInChildren <AIRig>();
        // Set the miner's state and behavior to be accessible in the behavior tree
        minerRig.AI.WorkingMemory.SetItem <int>("MinerState", 0);
        //minerRig.AI.WorkingMemory.SetItem<Miner.Location>("MinerLocation", Location.Mine);
        // Set the miner's thresholds to be visible in the behavior tree
        minerRig.AI.WorkingMemory.SetItem <int>("ComfortLevel", comfortLevel);
        minerRig.AI.WorkingMemory.SetItem <int>("ThirstThreshold", thirstThreshold);
        minerRig.AI.WorkingMemory.SetItem <int>("GoldThreshold", goldThreshold);
        // Set the initial values of the miner's variables to be seen in the behavior tree
        minerRig.AI.WorkingMemory.SetItem <int>("Fatigue", fatigue);
        minerRig.AI.WorkingMemory.SetItem <int>("Gold", gold);
        minerRig.AI.WorkingMemory.SetItem <int>("Thirst", thirst);
        minerRig.AI.WorkingMemory.SetItem <int>("Wealth", wealth);


        Debug.Log(
            ", GoldMAX " + minerRig.AI.WorkingMemory.GetItem <int>("GoldThreshold") +
            ", ThirstMAX " + minerRig.AI.WorkingMemory.GetItem <int>("ThirstThreshold") +
            ", WealthMAX " + minerRig.AI.WorkingMemory.GetItem <int>("ComfortLevel"));

        StartCoroutine(Thinker());
    }
Esempio n. 42
0
    // Use this for initialization
    void Start()
    {
        _hitPoints = 666;
        _actualAttacker = null;
        _listAttackers = new List<GameObject>();
        _actualTarget = null;

        if (tag == "Hellephant")
        {
            _hitPoints = _hellephantHP;
        }
        else if (tag == "Bunny")
        {
            _hitPoints = _bunnyHP;
        }
        else if (tag == "Boy")
        {
            _hitPoints = _boyHP;
        }
        else if (tag == "Player")
        {
            _hitPoints = _playerHP;
        }

        _tRig = gameObject.GetComponentInChildren<AIRig>();
        _tRig.AI.WorkingMemory.SetItem<int>("hitPoints", _hitPoints);
        _tRig.AI.WorkingMemory.SetItem<GameObject>("attacker", _actualAttacker);
    }
 void Start()
 {
     aiRig = GetComponentInChildren<AIRig> ();
 }
 // Use this for initialization
 void Start()
 {
     ai = GetComponent<AIRig> ();
 }
Esempio n. 45
0
 // Use this for initialization
 void Start()
 {
     aiRig = gameObject.GetComponentInChildren<AIRig> ();
 }
Esempio n. 46
0
 void Start()
 {
     aiRig = GetComponentInChildren<AIRig>();
     aiController = transform.GetComponentInChildren<SampleAIController>();
 }
 void Start()
 {
     m_soccerBallRig = GetComponent<AIRig>();
 }
Esempio n. 48
0
 // Use this for initialization
 void Start()
 {
     ghoulAiRig = gameObject.GetComponentInChildren<AIRig>();
     ghoulAi = ghoulAiRig.AI;
 }
Esempio n. 49
0
    // Use this for initialization
    void Start()
    {
        InitStats();
        InitStartingTable();
        BuildStats();

        gm = GameObject.Find("GameManager").GetComponent<GameManager>();

        ghoulAIRig = gameObject.GetComponentInChildren<AIRig>();
        ghoulAI = ghoulAIRig.AI;
    }
Esempio n. 50
0
 void Start()
 {
     GameController.instance.setGuard(this);
     ai = GetComponentInChildren<AIRig>();
 }
Esempio n. 51
0
 // Use this for initialization
 void Start()
 {
     npc = GetComponentInChildren<AIRig>();
 }
Esempio n. 52
0
 // Use this for initialization
 void Start()
 {
     poof = GameObject.Find("ghoul").GetComponentInChildren<ParticleSystem>();
     ai = GetComponentInChildren<AIRig>();
     possDelay = 0;
     possessible = false;
     anim = GetComponent<Animator> ();
     boneRig = gameObject.GetComponentsInChildren <Rigidbody>();
     colliders = gameObject.GetComponentsInChildren<Collider>();
     controller = anim.runtimeAnimatorController;
        // Revive();
 }
Esempio n. 53
0
    // Use this for initialization
    void Start()
    {
        zombieAiRig = gameObject.GetComponentInChildren<AIRig>();
        zombieAi = zombieAiRig.AI;

        trees = GameObject.Find("GameManager").GetComponent<GameManager>().trees;
        graves = GameObject.Find("GameManager").GetComponent<GameManager>().graves;
        SetTreeTarget(RandomTree());
        SetGraveTarget(RandomGrave());
    }
Esempio n. 54
0
    protected new void Start()
    {
        base.Start();

        HealthBar = GameObject.CreatePrimitive(PrimitiveType.Plane);
        HealthBar.renderer.material.color = Color.red;
        HealthBar.transform.parent = transform;
        HealthBar.transform.position = transform.position + Vector3.up * HealthBarPosition;
        HealthBar.collider.enabled = false;
        var s = new Vector3(HealthBarWidth, 1f, 0.01f);
        HealthBar.transform.localScale = s;

        AddEffectToWeapons(new Damage(BaseDamage));

        ai = GetComponentInChildren<AIRig>();
        ai.AI.Motor.DefaultSpeed = MovementSpeed;

        _randomSounds = GetComponent<RandomSoundPlayer>();
        _randomSounds.PlayRandomSound("Warcry");
    }
Esempio n. 55
0
 // Use this for initialization
 protected override void Awake()
 {
     base.Awake();
     aiRig = gameObject.GetComponentInChildren<AIRig>();
 }
Esempio n. 56
0
 void AI_INIT()
 {
     if (ai == null) {
         GameObject myInstance = Resources.Load ("AI_PREFABS/AI_LAND") as GameObject;
         GameObject newObj = (GameObject)GameObject.Instantiate (myInstance);
         newObj.name = this.gameObject.name + "_AI";
         newObj.transform.position = Vector3.zero;
         //new Vector3(0,0,0);
         newObj.transform.parent = this.gameObject.transform;
         newObj.transform.localPosition = Vector3.zero;
         //new Vector3(0,0,0);
         AIRig aiR = newObj.GetComponent<AIRig> ();
         aiR.AI.Body = this.gameObject;
         ai = aiR;
         ai.AI.WorkingMemory.SetItem<GameObject> ("playerUW", GameWorldController.instance.playerUW.gameObject);
         ai.AI.WorkingMemory.SetItem<int> ("attackMode", 0);//Default to melee combat
         ai.AI.Body = this.gameObject;
         ai.AI.Motor.DefaultSpeed = 2.0f * (((float)GameWorldController.instance.critter.Speed [objInt ().item_id - 64] / 12.0f));
         ai.AI.WorkingMemory.SetItem<float> ("Speed", ai.AI.Motor.DefaultSpeed);
     }
 }
Esempio n. 57
0
 // Use this for initialization
 void Start()
 {
     posicionInicial = transform.position;
     aiRig = GetComponentInChildren<AIRig>();
 }