예제 #1
0
 void OnMouseDown()
 {
     if (gridManager.activeButton != null && gridManager.activeButton.GetComponent <Ressource>().materialGroup == materialGroup)
     {
         material = gridManager.activeButton.GetComponent <Ressource>().material;
         this.GetComponent <SpriteRenderer>().sprite = gridManager.activeSprite;
     }
 }
예제 #2
0
	} // END Update

    public StorageRessource GetStorageRessource(MATERIALS material)
    {
        int resIndex = materialsType.FindIndex(x => x == material);
        if (resIndex == -1) return null;
        else return materialsObject[resIndex].GetComponent<StorageRessource>();
    }