void createAnOrb() { GameObject spawned = (GameObject)Instantiate(resource, transform.position + new Vector3(0f, 0f, -1f), Quaternion.identity); ResourceObjectLogic crf = spawned.GetComponent <ResourceObjectLogic>(); crf.globalResource = false; }
void Spawn() { GameObject spawned = (GameObject)Instantiate(energy, transform.position + Vector3.down, Quaternion.identity); ResourceObjectLogic cfr = spawned.GetComponent <ResourceObjectLogic>(); if (gameObject.tag != "Plant") { cfr.globalResource = true; } else { cfr.globalResource = false; } }