Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (controls.keyDown(controls.Outpost) && canSend && buildingPrefabs[0].GetComponent <resourceCost>().canAfford())
     {
         if (MetaScript.getOPController().checkDistance(transform.position))
         {
             if (MetaScript.getOPController().canAddOutPost())
             {
                 // Build surrounding area to avoid nav issues
                 MetaScript.getPlayer().GetComponent <DynamicGeneration>().generateSurrounding(Chunk.getChunkPos(transform.position));
                 canSend = false;
                 buildingPrefabs[0].GetComponent <resourceCost>().purchase();
                 Instantiate(buildingPrefabsObjects[0], gameObject.transform.position, Quaternion.identity);
                 StartCoroutine(canSendTimer());
                 MetaScript.getOPController().addOutpost();
             }
             else
             {
                 Debug.Log("Already at the outpost limit");
             }
         }
         else
         {
             Debug.Log("Campfire too close to other campfire or TC");
         }
     }
 }
Esempio n. 2
0
 public void recieveAction()
 {
     MetaScript.getOPController().destroyOutpost();
     Destroy(gameObject);
 }