Exemplo n.º 1
0
    public void initMe()
    {
        script = new SerializedObject(target);
        bl     = ((JSFBoardLayout)target);

        if (bl.gm == null)
        {
            bl.gm = bl.GetComponent <JSFGameManager>();            // assign gm ref if needed
        }

        // scripts to use
        scripts = bl.gm.panelManager.GetComponents <JSFPanelDefinition>();
        pieces  = bl.gm.pieceManager.GetComponents <JSFPieceDefinition>();

        // visual textures
        panelEditVisuals = script.FindProperty("panelEditVisuals");
        pieceEditVisuals = script.FindProperty("pieceEditVisuals");

        // weights
        colorWeight = script.FindProperty("colorWeight");

        // random on start boolean
        randomOnStart = script.FindProperty("randomOnStart");
        // show hex grid arrangement
        showHexGrid = script.FindProperty("showHexGrid");
        // use Selector boolean
        useSelector = script.FindProperty("useSelector");

        // max panels during randomization
        randomPanelLimit = script.FindProperty("randomPanelLimit");
        randomPanelCount = script.FindProperty("randomPanelCount");

        // gui usage booleans
        hidePanel1 = script.FindProperty("hidePanel1");
        hidePanel2 = script.FindProperty("hidePanel2");
        hidePanel3 = script.FindProperty("hidePanel3");

        // board GUI setups
        panelArray = script.FindProperty("panelArray");       // for the button arrays
        pStrength  = script.FindProperty("pStrength");        // for the strength fields
        pieceArray = script.FindProperty("pieceArray");       // for the piece types
        colorArray = script.FindProperty("colorArray");       // for the piece color type

        scrollPos  = script.FindProperty("scrollPos");        // for the scrollbar to conpensate for big boards
        scrollPos2 = script.FindProperty("scrollPos2");       // for the scrollbar to conpensate for big boards
        scrollPos3 = script.FindProperty("scrollPos3");       // for the scrollbar to conpensate for big boards
    }
    void OnGUI()
    {
        if (Selection.activeGameObject != null)
        {
            bl = Selection.activeGameObject.GetComponent <JSFBoardLayout>();

            if (bl != null)
            {
                showChoices();
            }
            else
            {
                showErrorMsg();                 // tells user to select the GameManger object
            }
        }
        else
        {
            showErrorMsg();             // tells user to select the GameManger object
        }
    }
Exemplo n.º 3
0
    void OnGUI()
    {
        GameObject sel = Selection.activeGameObject;

        if (sel != null)
        {
            JSFBoardLayout layout = sel.GetComponent <JSFBoardLayout>();

            if (layout != null)
            {
                Editor editor = Editor.CreateEditor(layout);
                editor.OnInspectorGUI();
            }
            else
            {
                showErrorMsg();                 // tells user to select the GameManger object
            }
        }
        else
        {
            showErrorMsg();             // tells user to select the GameManger object
        }
    }
Exemplo n.º 4
0
    void OnGUI()
    {
        if (Selection.activeGameObject != null)
        {
            bl = Selection.activeGameObject.GetComponent <JSFBoardLayout>();

            if (bl != null)
            {
                if (script == null)
                {
                    script = new SerializedObject(bl);
                }
                showWeights();
            }
            else
            {
                showErrorMsg();                 // tells user to select the GameManger object
            }
        }
        else
        {
            showErrorMsg();             // tells user to select the GameManger object
        }
    }