/**************************************************** * GObject Placer Setup * *************************************************/ /// <summary> /// UI callback to set the desired item in Object Placer /// </summary> /// <param name="index">Index of the item to select</param> public void UseItem(int index) { if (index >= 0 && index < buildObjectList.items.Count) { objPlacer.SetObjectToPlaceAndCreateGhost(buildObjectList.items[index]); if (OnItemSelect != null) { OnItemSelect(index); } } else { Debug.LogError("No item for index: " + index); } }
/**************************************************** * GObject Placer Setup * *************************************************/ /// <summary> /// UI callback to set the desired item in Object Placer /// </summary> /// <param name="index">Index of the item to select</param> public void UseItem(int index) { if (index >= 0 && index < buildObjectList.items.Count) { objPlacer.SetObjectToPlaceAndCreateGhost(buildObjectList.items[index]); Debug.Log("aaa"); BuildInterface.Instance.buildReqContent.gameObject.SetActive(true); BuildInterface.Instance.currentBuildIndex = index; BuildInterface.Instance.UpdateBuildSlots(); if (OnItemSelect != null) { OnItemSelect(index); } } else { Debug.LogError("No item for index: " + index); } }