maint: renamed player folder to units to match namespaces. added unit class as well.

This commit is contained in:
Chris
2025-10-04 01:05:37 -04:00
parent a80d1d487e
commit af0aab450b
38 changed files with 22 additions and 6 deletions

View File

@@ -0,0 +1,53 @@
using System;
using UnityEngine;
public interface ILockOnTarget {
public float lockonTargetRadius { set; }
Transform transform {get;}
GameObject gameObject{ get; }
abstract void OnTargetDelete();
void Help(){
SafelyDeleteTarget();
}
public Vector3 GetReticlePosition(){
float upValue = 0f;
if (gameObject.GetComponent<Renderer>()){
Bounds objectBounds = gameObject.GetComponent<Renderer>().bounds;
upValue = objectBounds.size.y;
}
Vector3 reticlePosition = new Vector3(transform.position.x, transform.position.y + upValue, transform.position.z);
return reticlePosition;
}
public void SafelyDeleteTarget(){
// gameObject.
foreach (LockOnManager.ActiveLockOnTarget target in LockOnManager.Instance.activeTargets) {
if (target.gameObject == this.gameObject) {
GameObject clone = new GameObject{name = $"Target Clone of {gameObject.name}", transform = { position = transform.position}};
target.gameObject = clone;
target.cinemachineTarget.Object = clone.transform;
LockOnManager.Instance.QueueTargetRemoval(clone, true);
}
}
}
}
public class PlayerCamera : MonoBehaviour{
void Start(){
}
// Update is called once per frame
void LateUpdate(){
}
}