Ejemplo n.º 1
0
    void OnGUI()
    {
        if (GUILayout.Button("Clear Save"))
        {
            PlayerPrefs.DeleteAll();
        }

        GUILayout.Space(20);
        GUILayout.Label("Wagon ID:");
        wagonID = GUILayout.TextField(wagonID);
        if (GUILayout.Button("Add Wagon"))
        {
            var wagon = GameManager.Instance.WagonData.FirstOrDefault(w => w.ID == wagonID);
            if (wagon != null)
            {
                FindObjectOfType <Vehicle>().AddWagon(SerialisationUtility.DeserialiseWagon(wagon));
            }
            else
            {
                Debug.LogError("Cant find wagon for name: " + wagonID);
            }
        }

        if (GUILayout.Button("GenerateEnums"))
        {
            EnumGenerator.GenerateEnumFile();
        }
    }