public float SearchRange = 20.0f; //the range at where the collector will search for resources void Start() { //get sripts: UnitMvt = gameObject.GetComponent <Unit> (); ResourceMgr = GameManager.Instance.ResourceMgr; SelectionMgr = GameManager.Instance.SelectionMgr; //Set the drop off initial settings: DropOff.Clear(); for (int i = 0; i < ResourceMgr.ResourcesInfo.Length; i++) { DropOffVars DropOffResource = new DropOffVars(); DropOffResource.Name = ResourceMgr.ResourcesInfo [i].TypeInfo.Name; DropOffResource.CurrentQuantity = 0; DropOff.Add(DropOffResource); } DroppingOff = false; //If the drop off model has been assigned if (DropOffObj != null) { //turn it off in the beginning DropOffObj.SetActive(false); } }
void Start() { //get sripts: UnitMvt = gameObject.GetComponent <Unit> (); ResourceMgr = GameManager.Instance.ResourceMgr; SelectionMgr = GameManager.Instance.SelectionMgr; //Set the drop off initial settings: DropOff.Clear(); for (int i = 0; i < ResourceMgr.ResourcesInfo.Length; i++) { DropOffVars DropOffResource = new DropOffVars(); DropOffResource.Name = ResourceMgr.ResourcesInfo [i].Name; DropOffResource.CurrentQuantity = 0; DropOff.Add(DropOffResource); } DroppingOff = false; }