void CheckGloves() { if (null == m_Gloves && null != m_View && m_View.hasView) { if (null != m_View.GetModelTransform("mountMain")) { UnityEngine.Object res = AssetsLoader.Instance.LoadPrefabImm(GlovesPrefabPath); if (null != res) { GameObject gameObj = Instantiate(res) as GameObject; if (null != gameObj) { m_Gloves = gameObj.GetComponent <PEGloves>(); m_Gloves.InitEquipment(Entity, null); } } } } if (null != m_Gloves && null == m_HeavyEquipmentCtrl.heavyEquipment) { if (m_HandChangeHold.handChangeEquipment == null) { m_HandChangeHold.handChangeEquipment = m_Gloves; } if (m_SwordAttack.sword == null) { m_SwordAttack.sword = m_Gloves; } m_MotionMgr.EndImmediately(PEActionType.SwordAttack); m_MotionMgr.EndImmediately(PEActionType.Fell); m_MotionMgr.EndImmediately(PEActionType.Dig); m_MotionMgr.EndImmediately(m_Gloves.m_HandChangeAttr.m_ActiveActionType); // m_ActiveableEquipment = m_Gloves; } }
void DeletGloves() { if (null != m_Gloves) { if (m_Sword == m_Gloves) { m_Sword = null; } if (m_HandChangeHold.handChangeEquipment == m_Gloves) { m_HandChangeHold.handChangeEquipment = null; } if (m_SwordAttack.sword == m_Gloves) { m_SwordAttack.sword = null; } if (null != m_View) { m_View.DetachObject(m_Gloves.gameObject); } GameObject.Destroy(m_Gloves.gameObject); m_Gloves = null; } }