void OnMouseDown() { if (gridManager.activeButton != null && gridManager.activeButton.GetComponent <Ressource>().materialGroup == materialGroup) { material = gridManager.activeButton.GetComponent <Ressource>().material; this.GetComponent <SpriteRenderer>().sprite = gridManager.activeSprite; } }
} // 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>(); }