RiftMayhem/Assets/Scripts/NPCProjectileSpawnLocationController.cs
Pedro Gomes a42b1ea784 Massive update on NPCs and damage over time effects
- NPC controller reworked completely
- ability priority list for npc's
- npc's with animations
- damage over time effect added
- burn, poison and bleed over time effects added
2024-07-19 21:57:47 +01:00

38 lines
1.2 KiB
C#

using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NPCProjectileSpawnLocationController : ProjectileSpawnLocationController
{
NPCController npcController;
NPCControllerBase npcControllerBase;
protected override void Awake()
{
npcController = GetComponentInParent<NPCController>();
photonView = GetComponentInParent<PhotonView>();
npcControllerBase = GetComponentInParent<NPCControllerBase>();
}
// Update is called once per frame
protected override void Update()
{
if(npcController == null)
{
if (npcControllerBase.currentTarget == null) return;
targetPoint = npcControllerBase.currentTarget.transform.position;
targetPoint.y = this.transform.position.y;
lookAt.forward = targetPoint - lookAt.position;
}
else
{
if (npcController.currentTarget == null) return;
targetPoint = npcController.currentTarget.transform.position;
targetPoint.y = this.transform.position.y;
lookAt.forward = targetPoint - lookAt.position;
}
}
}