Esempio n. 1
0
 void CheckTentacleMode()
 {
     if (!tentacleMode)
     {
         if (grounded && Input.GetButtonDown("EnterTentacleMode"))
         {
             tentacleMode = true;
             SpawnTentacle();
         }
     }
     else
     {
         if (tentacleHead != null && tentacleHead.Retracted())
         {
             Debug.Log("Exit tentacle mode");
             tentacleMode = false;
             DestroyImmediate(tentacleHead.gameObject);
             tentacleHead = null;
         }
     }
 }
Esempio n. 2
0
    void SpawnTentacle()
    {
        GameObject go = Instantiate <GameObject>(tentacleHeadPrefab, tentacleSpawnPoint.position, Quaternion.identity, transform.parent);

        tentacleHead = go.GetComponent <TentacleHead>();
    }