コード例 #1
0
    public ModelPlayer(GameObject node, ModelAttackRoleData attackData) : base(node, attackData)
    {
        m_curFoward = m_transform.rotation.eulerAngles.y;
        SetHands("Glove", "Glove");
        UIPrefab  prefab     = gameObject.GetComponent <UIPrefab>();
        Transform weaponNode = prefab.GetNode <Transform>("headusOBJexport009");

        m_weapon = weaponNode.GetComponent <ModelWeapon>();
        SetWeapon(m_weapon);
        m_bulletObj = Resources.Load <GameObject>("ModelBullet");
        m_weapon.SetBullet(m_bulletObj, OnTriggerEnter);
    }
コード例 #2
0
 public void SetWeapon(ModelWeapon weapon, Action <Collider> attackCallBack = null)
 {
     if (weapon == null)
     {
         DebugTool.LogError("ModelWeaponRole::SetWeapon weapon is null");
         return;
     }
     m_weapon = weapon;
     m_weapon.SetHands(m_leftHand, m_rightHand);
     m_leftHand  = null;
     m_rightHand = null;
     if (m_weapon.IsShortWeapon && attackCallBack != null)
     {
         m_weapon.SetCallBack(attackCallBack);
     }
 }