예제 #1
0
        /****************************************************
         * 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);
            }
        }
예제 #2
0
        /****************************************************
         * 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);
            }
        }