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

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

            updateRoutine = StartCoroutine(UpdateCoroutine());
        }
Example #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);
        }
Example #4
0
 protected abstract void OnPicked(PlayerUnit playerUnit);
Example #5
0
 protected override void OnPicked(PlayerUnit playerUnit)
 {
     playerUnit.AimController.CurrentWeapon.AddAmmo(ammoAmount);
 }
Example #6
0
 private void OnPlayerSpawn(PlayerUnit player)
 {
     playerTransform = player.transform;
 }
Example #7
0
 private void OnSightTriggerVolumeExit(TriggerVolume volume, Collider collider)
 {
     currentTarget = null;
     ChangeStateTo(BehaviorState.Patrolling);
 }
Example #8
0
 private void OnSightTriggerVolumeEnter(TriggerVolume volume, Collider collider)
 {
     currentTarget = collider.GetComponent<PlayerUnit>();
     ChangeStateTo(BehaviorState.SeekingTarget);
 }