Beispiel #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();
        IndicatorController controller = (IndicatorController)target;

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Apply"))
        {
            controller.SetVariables(controller.m_kill, controller.m_coin);
            controller.Apply();
        }
        if (GUILayout.Button("Reset"))
        {
            PlayerData.instance.SetDefault();
            controller.Apply();
        }
        EditorGUILayout.EndHorizontal();
    }