Inheritance: BaseUnit
Esempio n. 1
0
 private void OnPlayerSpawn(PlayerUnit player)
 {
     for (int i = 0; i < playerDependend.Length; i++)
     {
         IUIFromPlayer uiFromPlayer = playerDependend[i];
         uiFromPlayer.Initialize(player);
     }
 }
Esempio n. 2
0
        public void Initialize(PlayerUnit player)
        {
            baseWeapon = player.AimController.CurrentWeapon;

            if(updateRoutine!=null)
                StopCoroutine(updateRoutine);

            updateRoutine = StartCoroutine(UpdateCoroutine());
        }
Esempio n. 3
0
        public void Initialize(PlayerUnit player)
        {
            if(healthAttribute != null)
                healthAttribute.OnAttributeChange -= OnAttributeChange;

            currentPlayer = player;
            healthAttribute = currentPlayer.AttributePool.GetAttribute(AttributeType.Health);

            healthAttribute.OnAttributeChange += OnAttributeChange;

            OnAttributeChange(healthAttribute.MaxValue, healthAttribute.CurrentValue);
        }
Esempio n. 4
0
 protected abstract void OnPicked(PlayerUnit playerUnit);
Esempio n. 5
0
 protected override void OnPicked(PlayerUnit playerUnit)
 {
     playerUnit.AimController.CurrentWeapon.AddAmmo(ammoAmount);
 }
Esempio n. 6
0
 private void OnPlayerSpawn(PlayerUnit player)
 {
     playerTransform = player.transform;
 }
Esempio n. 7
0
 private void OnSightTriggerVolumeExit(TriggerVolume volume, Collider collider)
 {
     currentTarget = null;
     ChangeStateTo(BehaviorState.Patrolling);
 }
Esempio n. 8
0
 private void OnSightTriggerVolumeEnter(TriggerVolume volume, Collider collider)
 {
     currentTarget = collider.GetComponent<PlayerUnit>();
     ChangeStateTo(BehaviorState.SeekingTarget);
 }