Laser beam
This commit is contained in:
@@ -5,13 +5,14 @@ using UnityEngine;
|
||||
RequireComponent(typeof(Animator)),
|
||||
RequireComponent(typeof(BoxCollider2D))
|
||||
]
|
||||
public class Enemy : MonoBehaviour
|
||||
public class Ennemy : MonoBehaviour
|
||||
{
|
||||
private SpriteRenderer _sr;
|
||||
private Transform _player;
|
||||
|
||||
public float Speed = .1f;
|
||||
public int Damages = 1;
|
||||
public int Life = 100;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
@@ -20,6 +21,15 @@ public class Enemy : MonoBehaviour
|
||||
_player = GameObject.FindGameObjectWithTag("Player").transform;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Life <= 0)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
_player.GetComponent<PlayerManager>().MayorKills++;
|
||||
}
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (_player != null)
|
||||
@@ -15,7 +15,7 @@ GameObject:
|
||||
- component: {fileID: 247299863115505385}
|
||||
m_Layer: 0
|
||||
m_Name: Mayor
|
||||
m_TagString: Untagged
|
||||
m_TagString: Ennemy
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -120,7 +120,9 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: f4b3c6920a262c94696eed7deeec570f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
speed: 20
|
||||
Speed: 0.1
|
||||
Damages: 1
|
||||
Life: 100
|
||||
--- !u!61 &247299863115505385
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
Reference in New Issue
Block a user