예제 #1
0
    private void Update()
    {
        Move();
        // 임시 무기변경
        if (Input.GetKeyUp(KeyCode.Tab))
        {
            if (weaponMode == WeaponMode.Sword)
            {
                weaponMode = WeaponMode.Gun;
            }
            else
            {
                weaponMode = WeaponMode.Sword;
            }

            currentWeapon.gameObject.SetActive(false);
            CurrentWeapon = weaponInfo.weaponList[(int)weaponMode];
            currentWeapon.gameObject.SetActive(true);
        }

        if (Input.GetMouseButtonDown(0))
        {
            MouseAttack();
        }
    }
 public AbsCharacter OnInit(GameObject _gameObject, CharacterAttr _characterAttr, AbsWeapon _weapon, Vector3 _pos)
 {
     CharacterGameObject = _gameObject;
     CharacterGameObject.transform.position = _pos;
     CharacterAttr = _characterAttr;
     navMeshAgent  = _gameObject.GetComponent <NavMeshAgent>();
     audioSource   = _gameObject.GetComponent <AudioSource>();
     anim          = _gameObject.GetComponentInChildren <Animation>();
     collider      = _gameObject.GetComponent <CapsuleCollider>();
     Weapon        = _weapon;
     Weapon.OnInit(this);
     return(this);
 }
예제 #3
0
 public Minion(AbstractFactory forBody, AbstractFactory forWeapon)
 {
     body   = forBody.CreateBody();
     weapon = forWeapon.CreateWeapon();
 }
예제 #4
0
 public Minion(AbstractFactory factory)
 {
     body   = factory.CreateBody();
     weapon = factory.CreateWeapon();
 }
예제 #5
0
 private Minion(AbsBody b, AbsWeapon w)
 {
     body   = b;
     weapon = w;
     Console.WriteLine("создался клон обьекта ");
 }