Пример #1
0
        public override void OnOverlap(PlayerMovement pm)
        {
            HealthSystem health = pm.GetComponent <HealthSystem>();

            if (health)
            {
                health.Heal(healing);
            }
            Destroy(gameObject);
        }
Пример #2
0
        public override void OnOverlap(PlayerMovement pm)
        {
            HealthSystem health = pm.GetComponent <HealthSystem>();

            if (health)
            {
                health.TakeDamage(damageAmount);
            }



            Vector3 vToPlayer = (pm.transform.position - this.transform.position).normalized;

            pm.LaunchPlayer(vToPlayer * 20);
        }