Ejemplo n.º 1
0
    public virtual void SetWeaponType(EItemKey weaponRKey, EItemKey weaponLKey)
    {
        if (weaponRKey != EItemKey.None && weaponLKey != EItemKey.None)
        {
            //TODO: setup dual animation
        }
        else
        {
            EItemType weaponType = ItemsConfig.Instance.GetItem(weaponRKey != EItemKey.None ? weaponRKey : weaponLKey).Type;
            switch (weaponType)
            {
            case EItemType.W_Gun:
                _animRun            = EUnitAnimationState.Run_Gun;
                _animAttack         = EUnitAnimationState.Strike_Gun;
                _weaponStanceOffset = _gunStanceOffset;
                break;

            case EItemType.W_Rifle:
                _animRun            = EUnitAnimationState.Run_Rifle;
                _animAttack         = EUnitAnimationState.Strike_Rifle;
                _weaponStanceOffset = _rifleStanceOffset;
                break;
            }
        }
    }
Ejemplo n.º 2
0
    public void Awake()
    {
        if (_animator == null)
        {
            _animator = gameObject.GetComponent <Animator>();
        }

        _animDeath = (EUnitAnimationState)UnityEngine.Random.Range(_mainAnimationState[EUnitAnimationState.Death_FallForward], _mainAnimationState[EUnitAnimationState.Death_FallBack] + 1);

        if (_shootPositionTimeOffset > 0f)
        {
            _wfsAttackDelay = new WaitForSeconds(_shootPositionTimeOffset);
        }
    }
Ejemplo n.º 3
0
	public virtual void SetWeaponType(EItemKey weaponRKey, EItemKey weaponLKey) {
		if (weaponRKey != EItemKey.None && weaponLKey != EItemKey.None) {
			//TODO: setup dual animation
		} else {
			EItemType weaponType = ItemsConfig.Instance.GetItem(weaponRKey != EItemKey.None ? weaponRKey : weaponLKey).Type;
			switch (weaponType) {
				case EItemType.W_Gun:
					_animRun = EUnitAnimationState.Run_Gun;
					_animAttack = EUnitAnimationState.Strike_Gun;
					_weaponStanceOffset = _gunStanceOffset;
					break;
				case EItemType.W_Rifle:
					_animRun = EUnitAnimationState.Run_Rifle;
					_animAttack = EUnitAnimationState.Strike_Rifle;
					_weaponStanceOffset = _rifleStanceOffset;
					break;
			}
		}
	}
Ejemplo n.º 4
0
	public void Awake() {
		if (_animator == null) {
			_animator = gameObject.GetComponent<Animator>();
		}

		_animDeath = (EUnitAnimationState)UnityEngine.Random.Range(_mainAnimationState[EUnitAnimationState.Death_FallForward], _mainAnimationState[EUnitAnimationState.Death_FallBack] + 1);

		if (_shootPositionTimeOffset > 0f) {
			_wfsAttackDelay = new WaitForSeconds(_shootPositionTimeOffset);
		}
	}