Exemple #1
0
 private void hideEquipTip()
 {
     if (currentEquipTip != null)
     {
         ResourceManager.getInstance().getUIPool.Despawn(currentEquipTip.transform);
         currentEquipTip = null;
     }
 }
Exemple #2
0
 private void clear()
 {
     isShowTreeMenu  = true;
     isWalkCamea     = true;
     alertMSG        = null;
     currentEquipTip = null;
     currentModel    = null;
     currentGroup    = null;
 }
Exemple #3
0
        /// <summary>
        /// 显示设备顶部名称,设置显示名称,和设备中心点与设备顶部的偏移量
        /// </summary>
        /// <param name="equipName"></param>
        /// <param name="offset"></param>
        private EquipTip showEquipTip(string equipName, GameObject equipGameObject)
        {
            if (currentEquipTip == null)
            {
                GameObject obj = ResourceManager.getInstance().loadUISpawnPool("Prefabs/UI/MyUI/EquipTip", null);
                obj.transform.localPosition = Vector3.zero;
                currentEquipTip             = obj.GetComponent <EquipTip>();
            }
            Vector2 off = Vector2.zero;

            if (equipGameObject != null)
            {
                if (equipGameObject.GetComponent <Renderer>() != null)
                {
                    off = new Vector2(0, equipGameObject.GetComponent <Renderer>().bounds.max.y - equipGameObject.GetComponent <Renderer>().bounds.center.y);
                }
                currentEquipTip.init(Camera.main, equipGameObject.transform, off);
            }
            currentEquipTip.setValue(equipName);
            return(currentEquipTip);
        }
Exemple #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="value">显示的文字</param>
        ///<param name = "modelName" > 按钮对应的模型文件名</param>
        ///
        private void ShowEquiPTipByButton(string value, string modelName)
        {
            GameObject model = GameObject.Find(modelName);

            if (currentEquipTip == null)
            {
                GameObject obj = ResourceManager.getInstance().loadUISpawnPool("Prefabs/UI/MyUI/EquipTip", null);
                obj.transform.localPosition = Vector3.zero;
                currentEquipTip             = obj.GetComponent <EquipTip>();
            }
            Vector2 off = Vector2.zero;

            if (model != null)
            {
                if (model.GetComponent <Renderer>() != null)
                {
                    off = new Vector2(0, model.GetComponent <Renderer>().bounds.max.y - model.GetComponent <Renderer>().bounds.center.y);
                }
                currentEquipTip.init(Camera.main, model.transform, off);
            }
            currentEquipTip.setValue(value);
        }