Exemplo n.º 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);
 }
Exemplo n.º 3
0
 public Minion(AbstractFactory forBody, AbstractFactory forWeapon)
 {
     body   = forBody.CreateBody();
     weapon = forWeapon.CreateWeapon();
 }
Exemplo n.º 4
0
 public Minion(AbstractFactory factory)
 {
     body   = factory.CreateBody();
     weapon = factory.CreateWeapon();
 }
Exemplo n.º 5
0
 private Minion(AbsBody b, AbsWeapon w)
 {
     body   = b;
     weapon = w;
     Console.WriteLine("создался клон обьекта ");
 }