blob: 95ed2786652cd4950ff351b75235671b702d66c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MontanaJohns.Actors
{
[RequireComponent(typeof(Rigidbody2D))]
public class Enemy : Actor
{
GameObject player;
protected override void Awake()
{
base.Awake();
player = GameObject.FindGameObjectWithTag("Player");
}
// Update is called once per frame
void Update()
{
if (player.transform.position.x < transform.position.x) Move(-stats.speedMultiplier * 0.5f);
else Move(stats.speedMultiplier * 0.5f);
}
}
}
|