Beispiel #1
0
 void Awake()
 {
     if (instance == null)           //Check if instance already exists
     {
         instance = this;            //if not, set instance to this
     }
     else if (instance != this)      //If instance already exists and it's not this:
     {
         Destroy(gameObject);        //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
     }
 }
Beispiel #2
0
 public void BotonRefreshLoser()
 {
     canvasd = new CanvasD();
     canvasd.BotonRefresh();
 }
Beispiel #3
0
    public override void OnInspectorGUI()
    {
        if (SeeInspector.boolValue)                                                             // If true Default Inspector is drawn on screen
        {
            DrawDefaultInspector();
        }

        serializedObject.Update();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("See Inspector :", GUILayout.Width(85));
        EditorGUILayout.PropertyField(SeeInspector, new GUIContent(""), GUILayout.Width(30));
        EditorGUILayout.EndHorizontal();

        GUIStyle style_Yellow_01     = new GUIStyle(GUI.skin.box);   style_Yellow_01.normal.background = Tex_01;
        GUIStyle style_Blue          = new GUIStyle(GUI.skin.box);   style_Blue.normal.background = Tex_03;
        GUIStyle style_Purple        = new GUIStyle(GUI.skin.box);   style_Purple.normal.background = Tex_04;
        GUIStyle style_Orange        = new GUIStyle(GUI.skin.box);   style_Orange.normal.background = Tex_05;
        GUIStyle style_Yellow_Strong = new GUIStyle(GUI.skin.box);   style_Yellow_Strong.normal.background = Tex_02;


        GUILayout.Label("");
        CanvasD myScript = (CanvasD)target;

        EditorGUILayout.BeginVertical(style_Orange);
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Everything is unlocked :", GUILayout.Width(160));
        EditorGUILayout.PropertyField(obj, new GUIContent(""));
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Puzzle Automatically Solved :", GUILayout.Width(160));
        EditorGUILayout.PropertyField(puzzle, new GUIContent(""));
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Debug Text :", GUILayout.Width(160));
        EditorGUILayout.PropertyField(txtFeedback, new GUIContent(""));
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("UI Debug Button :", GUILayout.Width(160));

        string newString = "Activated";

        if (b_MobileButtons.boolValue)
        {
            newString = "Deactivated";
        }

        if (GUILayout.Button(newString))
        {
            Undo.RegisterFullObjectHierarchyUndo(myScript.btn_Puzzle, myScript.btn_Puzzle.name);
            Undo.RegisterFullObjectHierarchyUndo(myScript.btn_Objects, myScript.btn_Objects.name);

            if (!b_MobileButtons.boolValue)
            {
                myScript.btn_Puzzle.SetActive(false);
                myScript.btn_Objects.SetActive(false);
                b_MobileButtons.boolValue = true;
            }
            else
            {
                myScript.btn_Puzzle.SetActive(true);
                myScript.btn_Objects.SetActive(true);
                b_MobileButtons.boolValue = false;
            }
        }
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.EndVertical();

        EditorGUILayout.LabelField("");

        serializedObject.ApplyModifiedProperties();
    }