26 lines
689 B
C#
26 lines
689 B
C#
using UnityEngine;
|
|
|
|
public class MiniMapCam : MonoBehaviour
|
|
{
|
|
Transform playerTransform;
|
|
Transform camHomeTransform;
|
|
|
|
void LateUpdate()
|
|
{
|
|
if (playerTransform == null)
|
|
{
|
|
playerTransform = GameManager.Instance.PlayerController.transform;
|
|
}
|
|
if (camHomeTransform == null)
|
|
{
|
|
camHomeTransform = GameManager.Instance.PlayerController.cameraController.playerCamHome;
|
|
}
|
|
|
|
Vector3 newPosition = playerTransform.position;
|
|
newPosition.y = transform.position.y;
|
|
transform.position = newPosition;
|
|
|
|
transform.rotation = Quaternion.Euler(90, camHomeTransform.eulerAngles.y, 0);
|
|
}
|
|
}
|