Exemplo n.º 1
0
    public void ApplyChanges()
    {
        int killCount = 0;

        if (kill.text != "")
        {
            killCount = System.Convert.ToInt32(kill.text);
        }
        int coinCount = 0;

        if (coin.text != "")
        {
            coinCount = System.Convert.ToInt32(coin.text);
        }
        int xpCount = 0;

        if (xp.text != "")
        {
            xpCount = System.Convert.ToInt32(xp.text);
        }

        indicators.SetVariables(killCount, coinCount);
        indicators.Apply();

        levelBar.SetVariable(xpCount);
        levelBar.Apply();

        states.CheckStatesAgain();

        ClosePanel();
    }
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        LevelBarController controller = (LevelBarController)target;

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Apply"))
        {
            controller.SetVariable(controller.m_experience);
            controller.Apply();
        }
        if (GUILayout.Button("Reset"))
        {
            PlayerData.instance.SetDefault();
            controller.Apply();
        }
        EditorGUILayout.EndHorizontal();
    }