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