示例#1
0
        private void Update()
        {
            if (currentWeapon != null)
            {
                currentWeapon.MonoBehaviour.transform.localPosition = Vector3.zero;
                currentWeapon.MonoBehaviour.transform.localRotation = Quaternion.identity;
            }

            if (Input.GetButtonDown("Action"))
            {
                if (currentWeapon == null)
                {
                    //punch
                }
                else
                {
                    //shoot
                    //possibly throw
                    currentWeapon.Action();
                }
            }
            if (Input.GetButtonDown("Throw"))
            {
                if (currentWeapon == null)
                {
                    TryPickUp();
                }
                else
                {
                    Throw();
                }
            }
        }
示例#2
0
 public void Attack()
 {
     Console.WriteLine(this.name + " begin Attack: ");
     implement.Action();
 }
示例#3
0
 public void perFromWeapon()
 {
     Weapon.Action();
 }
示例#4
0
 public void Action()
 {
     Console.Write("The name of the hero is "
                   + this._nameHero + " and he ");
     _weapon.Action();
 }