Example #1
0
    private void DrawObstacleInterface()
    {
        string[] listChoicesObstacles = CreateListNameObstacles();
        string   nomObstacle;

        if (section.scriptSection)
        {
            section.name = section.scriptSection.name;
        }

        GUILayout.BeginHorizontal();

        GUILayout.BeginVertical();
        if (GUILayout.Button("obstacle\ngauche"))
        {
            ObstacleSelectionWindow.OpenObstacleSelectionWindow(section.tronconLeft);
        }
        nomObstacle = section.tronconLeft.obstacle == null ? "Aucun" : section.tronconLeft.obstacle.name;

        GUILayout.Label(nomObstacle);
        GUILayout.EndVertical();

        GUILayout.BeginVertical();
        if (GUILayout.Button("obstacle\ncentre"))
        {
            ObstacleSelectionWindow.OpenObstacleSelectionWindow(section.tronconCenter);
        }
        nomObstacle = section.tronconCenter.obstacle == null ? "Aucun" : section.tronconCenter.obstacle.name;

        GUILayout.Label(nomObstacle);
        GUILayout.EndVertical();

        GUILayout.BeginVertical();
        if (GUILayout.Button("obstacle\ndroite"))
        {
            ObstacleSelectionWindow.OpenObstacleSelectionWindow(section.tronconRight);
        }
        nomObstacle = section.tronconRight.obstacle == null ? "Aucun" : section.tronconRight.obstacle.name;

        GUILayout.Label(nomObstacle);
        GUILayout.EndVertical();

        GUILayout.EndHorizontal();
    }
    public static void OpenObstacleSelectionWindow(Troncon tronconToApply)
    {
        ObstacleSelectionWindow thisWindow = GetWindow <ObstacleSelectionWindow>("Sélectionne un obstacle");

        thisWindow.troncon = tronconToApply;
    }