Je n'arrive pas a désactiver mon GameObject arbre depuis mon script et je narrive pas a faire un cowntdown,
Quelqu'un pourrait m'aider ?
Voici mon script :
Code : Tout sélectionner
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CollectWood : MonoBehaviour {
public int WoodCollect = 2;
public int NumberCut = 3;
public GameObject Tree;
public void OnMouseDown()
{
if(NumberCut != 0)
{
Ressources.wood =+ WoodCollect;
NumberCut -= 1;
WoodCollect += 1;
}
if(NumberCut < 1)
{
Tree.SetActive(false);
}
}
}
Il vient d'un autre script, que voici :
Code : Tout sélectionner
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ressources : MonoBehaviour {
public static int wood = 10000;
public static int rock = 10000;
}
Merci de m'aider !
En fait, je suis en version 2017.5