/// <summary> /// Find the player lock on if enabled /// </summary> /// <returns>Transform that is currently locked onto.</returns> public static Transform GetLockOn() { GameObject player = FindPlayerInstance(); // get the player instance from invector if (player) { // valid? #if !VANILLA vLockOn lockon = player.GetComponent <vLockOn>(); // grab the lock on component if (lockon) { // found? return(lockon.currentTarget); // send the current target back } else { // fraid not return(null); // no lock on } #else return(null); // none invector lock on code here #endif } else { // player not found return(null); // no lock on } }
void Awake() { vCamera = vThirdPersonCamera.instance; vLock = this.GetComponent <vLockOn> (); }