示例#1
0
    // 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;
    }
示例#2
0
 void Start()
 {
     base.Start();
     cAth     = GetComponent <PRAC_Ath>();
     cZoneLog = GetComponent <DEF_ZoneLog>();
     cTackLog = GetComponent <DEF_TackLog>();
     cRushLog = GetComponent <DEF_RushLog>();
 }
示例#3
0
    void Start()
    {
        cRigid = GetComponent <Rigidbody>();
        cAcc   = GetComponent <PRAC_AI_Acc>();
        cAth   = GetComponent <PRAC_Ath>();

        cTackleBox.gameObject.SetActive(false);
    }
示例#4
0
    // 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;
    }
示例#5
0
    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;
    }
示例#6
0
    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);
        }
    }
示例#7
0
    // 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;
    }
示例#8
0
    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);
    }
示例#9
0
 void Start()
 {
     cAth = GetComponentInParent <PRAC_Ath>();
 }