2019-08-04 19:48:26 +02:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
2019-08-14 16:17:48 +02:00
|
|
|
|
using Saltosion.OneWeapon.Enemies;
|
|
|
|
|
using Saltosion.OneWeapon.Effects;
|
2019-08-14 19:05:16 +02:00
|
|
|
|
using Saltosion.OneWeapon.Environment;
|
2019-08-04 19:48:26 +02:00
|
|
|
|
|
2019-08-14 16:17:48 +02:00
|
|
|
|
namespace Saltosion.OneWeapon.Player {
|
2019-08-04 19:48:26 +02:00
|
|
|
|
public class PunchingHand : MonoBehaviour {
|
|
|
|
|
|
|
|
|
|
public bool Punching = false;
|
|
|
|
|
|
|
|
|
|
void Update() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OnTriggerEnter2D(Collider2D collider) {
|
|
|
|
|
if (Punching) {
|
|
|
|
|
Punching = false;
|
|
|
|
|
|
|
|
|
|
Explodable Explodable = collider.GetComponent<Explodable>();
|
2019-08-07 20:03:51 +02:00
|
|
|
|
Health Health = collider.GetComponent<Health>();
|
2019-08-16 20:46:34 +02:00
|
|
|
|
GunDropper VendingMachine = collider.GetComponent<GunDropper>();
|
2019-08-04 19:48:26 +02:00
|
|
|
|
Vector2 Direction = (collider.transform.position - transform.position).normalized;
|
|
|
|
|
if (Health != null) {
|
2019-08-14 21:31:58 +02:00
|
|
|
|
Health.Damage(8f, -Direction, true);
|
2019-08-14 19:05:16 +02:00
|
|
|
|
} else if (VendingMachine != null) {
|
|
|
|
|
VendingMachine.ExpelGun();
|
2019-08-04 19:48:26 +02:00
|
|
|
|
} else if (Explodable != null) {
|
|
|
|
|
Explodable.Explode(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|