コード例 #1
0
    // I guess for now we just start with zones.
    public void FDisplayPlay()
    {
        DPC_ZoneGFX[] zGX = FindObjectsOfType <DPC_ZoneGFX>();
        foreach (DPC_ZoneGFX gfx in zGX)
        {
            Destroy(gfx.gameObject);
        }

        // Now, iterate through all players, and spawn in a node representing their zone.
        PE_Role[] athletes = FindObjectsOfType <PE_Role>();
        foreach (PE_Role role in athletes)
        {
            if (role.mRole == "Zone")
            {
                // get the zone details from the IO
                DATA_Zone zone = IO_ZoneList.FLOAD_ZONE_BY_NAME(role.mDetails);
                if (zone != null)
                {
                    Vector2 vPos = rSnapSpot.transform.position;
                    vPos += zone.mSpot / 10f;
                    Instantiate(PF_ZoneGFX, vPos, transform.rotation);
                }
            }
        }
    }
コード例 #2
0
    void Start()
    {
        cSelector      = GetComponentInChildren <DPC_Selector>();
        cPlayDisplayer = GetComponentInChildren <DPC_PlayDisplayer>();

        IO_ZoneList.FLOAD_ZONES();
        mState = PLAYMENU_STATE.SDISPLAYPLAY;
    }
コード例 #3
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;
    }
コード例 #4
0
    // The play editor calls us.
    public void FRun_Update()
    {
        // // Basically, every time that we click, spawn a point, and destroy any exising points.
        // if(Input.GetMouseButtonDown(0)){
        //     // first, we raycast to make sure we're over the field. Because we can't spawn a player randomly off the field.
        //     RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);

        //     if(hit.collider != null)
        //     {
        //         if(hit.collider.GetComponent<PE_Field>() != null){
        //             Vector3 pos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
        //             pos.z = 90;
        //             SpawnPointDestroyOld(pos);
        //         }
        //     }
        // }

        // // Also, do the conversion and shove the zone details into the zone.
        // DPC_ZoneSpot spot = FindObjectOfType<DPC_ZoneSpot>();
        // if(spot != null)
        // {
        //     // now "shove" the detail about it into itself.
        //     // do a conversion to find the pixels -> yards.
        //     Vector2 vYards = spot.transform.position - rSnapSpot.transform.position;
        //     vYards /= 50f/rField.GetComponent<RectTransform>().rect.width;
        //     vYards.x = (float)System.Math.Round(vYards.x, 0);
        //     vYards.y = (float)System.Math.Round(vYards.y, 0);
        //     spot.mZone.mSpot = vYards;
        //     rZonePos.text = "("+vYards.x+", "+vYards.y+")";

        //     // Now find out what the name of the zone is.
        //     spot.mZone.mName = rZoneName.text;
        // }
        if (Input.GetMouseButtonDown(1))
        {
            // // Now we just load in all the zones, then display them.
            DATA_Zone zone      = IO_ZoneList.FLOAD_ZONE_BY_NAME(mZoneToSpawn);
            Vector2   vZoneSpot = zone.mSpot;
            vZoneSpot /= 10f;
            vZoneSpot += (Vector2)rSnapSpot.transform.position;
            var clone = Instantiate(PF_ZoneSpot, vZoneSpot, transform.rotation);
            clone.mZone = zone;
        }
    }
コード例 #5
0
ファイル: MN_Splash.cs プロジェクト: tdcoish/SW_Quarterback
    void Start()
    {
        IO_DefPlays.FLOAD_PLAYS();
        IO_PlayList.FLOAD_PLAYS();
        IO_RouteList.FLOAD_ROUTES();
        IO_Settings.FLOAD_SETTINGS();
        IO_ZoneList.FLOAD_ZONES();

        mDebugText.text = "Loading in stuffs";

        // IO_RouteList.FWRITE_ALL_ROUTES_AS_TEXT();
        DeleteOldFilesFromPlayArtDirectories();
        TransferCurrentFormationsAndPlaysIntoPlayArtDirectories();

        mDebugText.text = "Should have transfered text files with formation and plays";

        mState = SplashState.SLOGO;
        mAudioMixer.SetFloat("MASTER_VOLUME", IO_Settings.mSet.lMasterVolume);

        ENTER_Logo();
    }
コード例 #6
0
    private void RenderZone(DT_PlayerRole role, PLY_SnapSpot snapSpot)
    {
        // get the zone details.
        DATA_Zone zn = IO_ZoneList.FLOAD_ZONE_BY_NAME(role.mDetail);
        GFX_Zone  zoneGFX;

        if (zn.mSpot.y > 19f)
        {
            // render using the "deep zone" version.
            zoneGFX = GFX_DeepZone;
        }
        else if (zn.mSpot.y > 9f)
        {
            // render using mid zone version
            zoneGFX = GFX_MidZone;
        }
        else
        {
            // render using shallow zone version.
            zoneGFX = GFX_ShallowZone;
        }

        Vector3 vZonePos = snapSpot.transform.position;

        vZonePos.z += zn.mSpot.y;
        vZonePos.x += zn.mSpot.x;
        Instantiate(zoneGFX, vZonePos, transform.rotation);

        Vector3 vStartPos = UT_VecConversion.ConvertVec2(role.mStart);

        vStartPos += snapSpot.transform.position;
        Vector3 vIterPos = vStartPos;
        Vector3 vDir     = Vector3.Normalize(vZonePos - vStartPos);

        while (Vector3.Dot(vDir, vZonePos - vIterPos) > 0f)
        {
            Instantiate(GFX_ZoneTrail, vIterPos, transform.rotation);
            vIterPos += vDir * 0.5f;
        }
    }
コード例 #7
0
ファイル: PRAC_Man.cs プロジェクト: tdcoish/SW_Quarterback
    void Start()
    {
        cPlaySetter  = GetComponent <PRAC_SetUpPlay>();
        cShowDefence = GetComponent <PRAC_ShowDefense>();

        mState         = PRAC_STATE.SPOST_PLAY;
        mPreSnapState  = PRESNAP_STATE.SREADYTOSNAP;
        mPickPlayState = PICKPLAY_STATE.SOFFENSE;
        IO_PlayList.FLOAD_PLAYS();
        IO_DefPlays.FLOAD_PLAYS();
        IO_ZoneList.FLOAD_ZONES();

        IO_RouteList.FLOAD_ROUTES();

        PRS_AssignMan.FLOAD_PRIORITIES();

        // Won't affect the build, but will affect the editor.
        IO_Settings.FLOAD_SETTINGS();
        // IO_RouteList.FCONVERT_TO_TEXT_FILES();
        // IO_PlayList.FCONVERT_TO_TEXT_FILES();
        // IO_DefPlays.FCONVERT_TO_TEXT_FILES();
        // IO_ZoneList.FCONVERT_TO_TEXT_FILES();
        MN_PauseScreen.SetActive(false);
    }
コード例 #8
0
    public void BT_SaveZone()
    {
        DPC_ZoneSpot zone = FindObjectOfType <DPC_ZoneSpot>();

        IO_ZoneList.FWRITE_ZONE(zone.mZone);
    }
コード例 #9
0
 void Awake()
 {
     IO_Settings.FLOAD_SETTINGS();
     IO_DefPlays.FLOAD_PLAYS();
     IO_ZoneList.FLOAD_ZONES();
 }