Ejemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        WM_Player P = (WM_Player)target;

        // SETBASE
        //Debug.Log("heresy " + FBase?.name);
        int size = CG.Graph.Count;

        string[] options = new string[size];
        if (FBase == null) // if new graph was created then lost previous base link, so give a new base
        {
            FBase      = CG.Graph[0];
            FBaseIndex = 0;
        }
        for (int i = 0; i < size; i++)
        {
            if (FBase.name == CG.Graph[i].name)
            {
                FBaseIndex = i;                                 // so that the popup shows the current base
            }
            options[i] = CG.Graph[i].name;
        }
        FBaseIndex = EditorGUILayout.Popup("Select Initial Base", FBaseIndex, options);
        FBase      = CG.Graph[FBaseIndex];
        if (GUILayout.Button("Set Base"))
        {
            P.SetInitialNode(FBase); // force the base initialisation if new graph
        }
    }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        CreateGraph CG = FindObjectOfType <CreateGraph>();

        player.SetInitialNode(CG.Graph[101]); // node 14
        light.SetBase(CG.Graph[78 + 5]);
        dark.SetBase(CG.Graph[10]);
    }