refactor: moved a lot of player related scripts to the Reset.Units namespace
This commit is contained in:
@@ -1,46 +1,50 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public interface ILockOnTarget {
|
||||
public float lockonTargetRadius { set; get; }
|
||||
public bool lockonDebug { set; get; }
|
||||
namespace Reset.Units{
|
||||
public interface ILockOnTarget{
|
||||
public float lockonTargetRadius{ set; get; }
|
||||
public bool lockonDebug{ set; get; }
|
||||
|
||||
public float lockonRaycastVerticalOffset { set; get; }
|
||||
|
||||
Transform transform {get;}
|
||||
GameObject gameObject{ get; }
|
||||
public float lockonRaycastVerticalOffset{ set; get; }
|
||||
|
||||
abstract void OnTargetDelete();
|
||||
Transform transform{ get; }
|
||||
GameObject gameObject{ get; }
|
||||
|
||||
void Help(){
|
||||
SafelyDeleteTarget();
|
||||
}
|
||||
|
||||
public Vector3 GetReticlePosition(){
|
||||
float upValue = 0f;
|
||||
|
||||
if (gameObject.GetComponent<Renderer>()){
|
||||
Bounds objectBounds = gameObject.GetComponent<Renderer>().bounds;
|
||||
upValue = objectBounds.size.y;
|
||||
upValue = 4f;
|
||||
abstract void OnTargetDelete();
|
||||
|
||||
void Help(){
|
||||
SafelyDeleteTarget();
|
||||
}
|
||||
|
||||
Vector3 reticlePosition = new Vector3(transform.position.x, transform.position.y + upValue, transform.position.z);
|
||||
public Vector3 GetReticlePosition(){
|
||||
float upValue = 0f;
|
||||
|
||||
return reticlePosition;
|
||||
}
|
||||
if (gameObject.GetComponent<Renderer>()) {
|
||||
Bounds objectBounds = gameObject.GetComponent<Renderer>().bounds;
|
||||
upValue = objectBounds.size.y;
|
||||
upValue = 4f;
|
||||
}
|
||||
|
||||
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}};
|
||||
Vector3 reticlePosition =
|
||||
new Vector3(transform.position.x, transform.position.y + upValue, transform.position.z);
|
||||
|
||||
target.gameObject = clone;
|
||||
target.cinemachineTarget.Object = clone.transform;
|
||||
|
||||
LockOnManager.Instance.QueueTargetRemoval(clone, true);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user