// Maybe have this as a function that we call. void Start() { cRigid = GetComponent <Rigidbody>(); cAth = GetComponent <PRAC_Ath>(); cForces = GetComponent <ATH_Forces>(); rSnapSpot = FindObjectOfType <PLY_SnapSpot>().transform.position; }
void Start() { base.Start(); cAth = GetComponent <PRAC_Ath>(); cZoneLog = GetComponent <DEF_ZoneLog>(); cTackLog = GetComponent <DEF_TackLog>(); cRushLog = GetComponent <DEF_RushLog>(); }
void Start() { cRigid = GetComponent <Rigidbody>(); cAcc = GetComponent <PRAC_AI_Acc>(); cAth = GetComponent <PRAC_Ath>(); cTackleBox.gameObject.SetActive(false); }
// public enum JOB_STATE{ // S_ASSIGNMENT, // S_BREAK_ON_BALL // } void Awake() { cAth = GetComponent <PRAC_Ath>(); cRouteLog = GetComponent <OFF_RouteLog>(); cCatchLog = GetComponent <RP_CatchLog>(); cRigid = GetComponent <Rigidbody>(); rManager = FindObjectOfType <RP_Manager>(); mState = STATE.SPRE_SNAP; }
private void Awake() { cRigid = GetComponent <Rigidbody>(); cCatchLog = GetComponent <RP_CatchLog>(); cCatchRadius = GetComponentInChildren <TRG_Catch>(); cAcc = GetComponent <PRAC_AI_Acc>(); cAth = GetComponent <PRAC_Ath>(); mState = STATE.S_BLIND; }
public void E_BallChangesHands() { // spawn a star on that guy. PRAC_Ath athWithBall = cMan.FGetBallCarrier(); if (athWithBall != null) { Vector3 vPos = athWithBall.transform.position; vPos.y = 0.1f; var clone = Instantiate(PF_StarGFX, vPos, athWithBall.transform.rotation); clone.transform.SetParent(athWithBall.transform); } }
// Maybe have this as a function that we call. void Start() { cRigid = GetComponent <Rigidbody>(); cAth = GetComponent <PRAC_Ath>(); cAcc = GetComponent <PRAC_AI_Acc>(); cCatchLog = GetComponent <RP_CatchLog>(); if (cAth.mJob.mRole == "Zone") { mZoneSpot = IO_ZoneList.FLOAD_ZONE_BY_NAME(cAth.mJob.mDetail).mSpot; mZoneSpot.z = mZoneSpot.y; mZoneSpot.y = 0f; PLY_SnapSpot snap = FindObjectOfType <PLY_SnapSpot>(); mZoneSpot += snap.transform.position; } mState = STATE.S_GETTING_TO_SPOT; }
public void FRun() { // Depends if they're running towards or away from me. -- MAYBE // Only matters when I add moves into the game. Then, if behind, always chase down full speed. // But if ahead, then maybe hold up so you don't get deked out. PRAC_Ath rBallCarrier = cAth.rMan.FGetBallCarrier(); if (rBallCarrier == null) { return; } // Say, run to where they're going to be, in one second, unless you're within 5 m, then shorten that time proportionally. float fLeadPerc = 0f; float fDis = Vector3.Distance(transform.position, rBallCarrier.transform.position); if (fDis > 5f) { fLeadPerc = 1f; } else { fLeadPerc = 5f / fDis; } Vector3 vSpotToMoveTo = rBallCarrier.transform.position; vSpotToMoveTo += rBallCarrier.GetComponent <Rigidbody>().velocity *fLeadPerc; // so move 1 second ahead of them, unless we're really close. // they also need to be keeping the endzone between them and the ball carrier. Vector3 vDir = vSpotToMoveTo - transform.position; vDir = Vector3.Normalize(vDir); Vector3 vAcc = cAcc.FCalcAccFunc(vDir, cAcc.mSpd); cRigid.velocity += vAcc; if (cRigid.velocity.magnitude > cAcc.mSpd) { cRigid.velocity *= cAcc.mSpd / cRigid.velocity.magnitude; } transform.forward = Vector3.Normalize(cRigid.velocity); }
void Start() { cAth = GetComponentInParent <PRAC_Ath>(); }