Ejemplo n.º 1
0
    };                                                                                             // Lock Section : Check if an Object is in the player inventory using his ID


    // Use this for initialization
    void Start()
    {
        //--> Every Puzzle  ----> BEGIN <----
        camManager = GetComponent <focusCamEffect>();
        _conditionsToAccessThePuzzle = GetComponent <conditionsToAccessThePuzzle>();
        _actionsWhenPuzzleIsSolved   = GetComponent <actionsWhenPuzzleIsSolved>();
        //----> END <----


        //--> Common for all puzzle ----> BEGIN <----
        _detectClick = new detectPuzzleClick();                 // Access Class that allow to detect click (Mouse, Joystick, Mobile)


        for (var i = 0; i < lightList.Count; i++)
        {
            if (lightList[i] != null)
            {
                lightList[i] = lightList[i].GetComponent <Renderer>();
            }
        }



        a_Source = GetComponent <AudioSource>();
        //----> END <----
    }
Ejemplo n.º 2
0
//--> remove Selected ID
    private void removeSelectedID(int i)
    {
        conditionsToAccessThePuzzle myScript = (conditionsToAccessThePuzzle)target;

        Undo.RegisterFullObjectHierarchyUndo(myScript, myScript.name);
        myScript.inventoryIDList.RemoveAt(i);
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        dragAndDrop = GetComponent <AP_.DragAndDrop>();

        for (var i = 0; i < pivotLogicList.Count; i++)
        {
            listOfSelectedPuzzlePosition.Add(pivotLogicList[i].transform.parent.GetComponent <SpriteRenderer>());
            pLogicList.Add(LogicList[i].GetComponent <Logic>());
            pLogicOnTriggerList.Add(LogicList[i].transform.GetChild(0).GetComponent <LogicCheckCollision>());
            inGameLogicsPositionList.Add(-1);
            inGameAxis.Add(false);

            if (!LogicsInitPositionWhenStart[i])
            {
                LogicList[i].transform.GetChild(0).tag = "Untagged";
                pivotLogicList[i].transform.parent.GetComponent <Collider>().enabled = false;
                LogicList[i].transform.GetChild(0).GetComponent <Collider>().enabled = false;
            }
        }

        //--> Every Puzzle  ----> BEGIN <----
        camManager = GetComponent <focusCamEffect>();
        _conditionsToAccessThePuzzle = GetComponent <conditionsToAccessThePuzzle>();
        _actionsWhenPuzzleIsSolved   = GetComponent <actionsWhenPuzzleIsSolved>();
        //----> END <----


        //--> Common for all puzzle ----> BEGIN <----
        _detectClick = new detectPuzzleClick();                 // Access Class that allow to detect click (Mouse, Joystick, Mobile)



        a_Source = GetComponent <AudioSource>();
        //----> END <----
    }
Ejemplo n.º 4
0
//--> Display custom methods used to know if the puzzle could be activated
    private void showCustomMethods(GUIStyle style_Purple, GUIStyle style_Blue)
    {
        conditionsToAccessThePuzzle myScript = (conditionsToAccessThePuzzle)target;

        //-> Custom methods
        EditorGUILayout.BeginVertical(style_Purple);
        EditorGUILayout.BeginHorizontal();
        GUILayout.Label("Methods checked to activate the puzzle", EditorStyles.boldLabel);
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.HelpBox(
            "Only bool Method are allowed. Other methods are ignored.", MessageType.Info);

        if (GUILayout.Button("+", GUILayout.Width(30)))
        {
            b_addMethods = true;
        }

        editorMethods.DisplayMethodsOnEditor(myScript.methodsList, methodsList, style_Blue);

        if (b_addMethods)
        {
            editorMethods.AddMethodsToList(methodsList);
            b_addMethods = false;
        }

        EditorGUILayout.EndVertical();
    }
Ejemplo n.º 5
0
    };                                                                                             // Lock Section : Check if an Object is in the player inventory using his ID


    // Use this for initialization
    void Start()
    {
        //--> Every Puzzle  ----> BEGIN <----
        camManager = GetComponent <focusCamEffect>();
        _conditionsToAccessThePuzzle = GetComponent <conditionsToAccessThePuzzle>();
        _actionsWhenPuzzleIsSolved   = GetComponent <actionsWhenPuzzleIsSolved>();
        //----> END <----


        //--> Common for all puzzle ----> BEGIN <----
        _detectClick = new detectPuzzleClick();                 // Access Class that allow to detect click (Mouse, Joystick, Mobile)

        for (var i = 0; i < positionList.Count; i++)            // Save the default Mix. Use when puzzle is reset.
        {
            refPositionList.Insert(0, 0);
        }

        for (var i = 0; i < refPositionList.Count; i++)
        {
            refPositionList[i] = positionList[i];
        }

        a_Source = GetComponent <AudioSource>();
        //----> END <----
    }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        camManager = GetComponent <focusCamEffect>();
        _conditionsToAccessThePuzzle = GetComponent <conditionsToAccessThePuzzle>();
        _actionsWhenPuzzleIsSolved   = GetComponent <actionsWhenPuzzleIsSolved>();

        //GameObject tmpObj = GameObject.Find("VoiceOver_Manager");
        //tmpObj = GameObject.Find("VoiceOver_Manager");
        // if (tmpObj) voiceOverManager = tmpObj.GetComponent<VoiceOver_Manager>();
    }
Ejemplo n.º 7
0
//--> add New Needed ID
    private void addNewNeededID(int i)
    {
        conditionsToAccessThePuzzle myScript = (conditionsToAccessThePuzzle)target;

        Undo.RegisterFullObjectHierarchyUndo(myScript, myScript.name);
        if (i == 0)
        {
            myScript.inventoryIDList.Insert(i, new conditionsToAccessThePuzzle.idList());
        }
        else
        {
            myScript.inventoryIDList.Insert(i + 1, new conditionsToAccessThePuzzle.idList());
        }
    }
Ejemplo n.º 8
0
    };                                                                             // Lock Section : Check if an Object is in the player inventory using his ID


    // Use this for initialization
    void Start()
    {
        //--> Every Puzzle  ----> BEGIN <----
        camManager = GetComponent <focusCamEffect>();
        _conditionsToAccessThePuzzle = GetComponent <conditionsToAccessThePuzzle>();
        _actionsWhenPuzzleIsSolved   = GetComponent <actionsWhenPuzzleIsSolved>();
        //----> END <----


        //--> Common for all puzzle ----> BEGIN <----
        _detectClick = new detectPuzzleClick();                 // Access Class that allow to detect click (Mouse, Joystick, Mobile)

        a_Source = GetComponent <AudioSource>();
        //----> END <----
    }
Ejemplo n.º 9
0
    //private Texture2D         Tex_05;



    void OnEnable()
    {
        // Setup the SerializedProperties.
        SeeInspector  = serializedObject.FindProperty("SeeInspector");
        onlyFocusMode = serializedObject.FindProperty("onlyFocusMode");

        b_feedbackActivated = serializedObject.FindProperty("b_feedbackActivated");
        feedbackIDList      = serializedObject.FindProperty("feedbackIDList");

        conditionsToAccessThePuzzle myScript = (conditionsToAccessThePuzzle)target;

        editorMethods   = new EditorMethods();
        methodsList     = serializedObject.FindProperty("methodsList");
        inventoryIDList = serializedObject.FindProperty("inventoryIDList");

        Tex_01 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f));
        Tex_02 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f));
        Tex_04 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .2f));
    }
Ejemplo n.º 10
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_01;
        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_01;
        GUIStyle style_Yellow_Strong = new GUIStyle(GUI.skin.box);   style_Yellow_Strong.normal.background = Tex_02;

        if (!onlyFocusMode.boolValue)
        {
            conditionsToAccessThePuzzle myScript = (conditionsToAccessThePuzzle)target;

            //-> Display Inventory ID needed to start the puzzle
            displayNeededInventoryID(style_Yellow_01);


            //-> Show Custom Methods
            EditorGUILayout.BeginVertical(style_Orange);
            showCustomMethods(style_Purple, style_Blue);
            EditorGUILayout.EndVertical();

            //-> Display feedback ID used when the puzzle is not available
            displayFeedbackWhenPuzzleIsLocked(style_Yellow_01);
        }

        serializedObject.ApplyModifiedProperties();
        EditorGUILayout.LabelField("");
    }