예제 #1
0
    void createAnOrb()
    {
        GameObject          spawned = (GameObject)Instantiate(resource, transform.position + new Vector3(0f, 0f, -1f), Quaternion.identity);
        ResourceObjectLogic crf     = spawned.GetComponent <ResourceObjectLogic>();

        crf.globalResource = false;
    }
예제 #2
0
    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;
        }
    }