コード例 #1
0
    // Use this for initialization
    void Start()
    {
        LoadFullData();

        CameraDefaultView     = Camera.main.transform.position;
        CameraDefaultRotation = Camera.main.transform.rotation;

        newPlayerPosition        = GameObject.FindGameObjectWithTag("newplayerpos").transform;
        newDefensePlayerPosition = GameObject.FindGameObjectWithTag("newdefenseplayerpos").transform;
        Camera3DView             = GameObject.FindGameObjectWithTag("3DView").transform.position;
        Camera3DRotation         = GameObject.FindGameObjectWithTag("3DView").transform.rotation;
        var cam = FindObjectOfType <Camera>();

        if (cam != null)
        {
            if (cam.tag == "ScreenShootCam")
            {
                ScreenShootCamera = cam;
            }
        }

        PLAYS.ClearOptions();
        PLAYS.AddOptions(new List <string> {
            "Choose Play"
        });
        FORMATIONS.ClearOptions();
        FORMATIONS.AddOptions(new List <string> {
            "Choose formation"
        });


        GetAllDataAtStart();
    }
コード例 #2
0
    /// <summary>
    /// Using this. Loading formation data
    /// </summary>
    /// <param name="formation"></param>
    public void OnSelectedFormation(Dropdown formation)
    {
        int menuIndex     = formation.GetComponent <Dropdown>().value;
        var formationname = formation.options[menuIndex].text;


        foreach (var item in allFormations.AllFormmations)
        {
            if (item.FormationName == formationname)
            {
                Debug.Log(item.FormationID);
                SelectedFormation = item.FormationID;
                var playsCount = allFormations.AllFormmations[item.FormationID].LinkedPlaysWithFormation.Count;
                PlaysNames.Clear();
                for (int i = 0; i < playsCount; i++)
                {
                    PlaysNames.Add(allFormations.AllFormmations[item.FormationID].LinkedPlaysWithFormation[i].PlayName);
                }
            }
        }


        PLAYS.ClearOptions();
        PLAYS.AddOptions(new List <string> {
            "Choose Play"
        });
        PLAYS.AddOptions(PlaysNames);
        UIManager.Instance.LoadFormation(false);
    }