Esempio n. 1
0
    void Start()
    {
        renderPerC   = GetComponent <Renderer>();
        colorInicial = renderPerC.material.color;

        construirTorres = ScriptConstruirTorres.instance;
    }
 //Només un ScriptConstruirTorres però amb instancies al iniciar-ho amb la variable de abaix
 void Awake()
 {
     if (instance != null)
     {
         Debug.LogError("Més d'un Script ScriptConstruirTorres en la escena");
     }
     instance = this;
 }
 void Start()
 {
     construirTorres = ScriptConstruirTorres.instance;
 }