Example #1
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;



        JoystickReticule myScript = (JoystickReticule)target;

        EditorGUILayout.BeginVertical(style_Orange);
        EditorGUILayout.HelpBox("This script allow to setup the fake Joystick cursor behaviour", MessageType.Info);

//--> Joystick sensibility
        EditorGUILayout.BeginHorizontal();
        GUILayout.Label("Joystick sensibility : ", GUILayout.Width(120));
        EditorGUILayout.PropertyField(sensibilityJoystick, new GUIContent(""));
        EditorGUILayout.EndHorizontal();

//--> Animation Curve
        EditorGUILayout.BeginHorizontal();
        GUILayout.Label("Animation Curve : ", GUILayout.Width(120));
        EditorGUILayout.PropertyField(animationCurveJoystick, new GUIContent(""));
        EditorGUILayout.EndHorizontal();

//--> Joystick Input to move fake cursor Horizontaly
        EditorGUILayout.BeginHorizontal();
        GUILayout.Label("Horizontal : ", GUILayout.Width(120));
        horizontalJoystick.intValue = EditorGUILayout.Popup(horizontalJoystick.intValue, s_inputListJoystickAxis.ToArray());
        EditorGUILayout.EndHorizontal();

//--> Joystick Input to move fake cursor verticaly
        EditorGUILayout.BeginHorizontal();
        GUILayout.Label("Vertical : ", GUILayout.Width(120));
        verticaJloystick.intValue = EditorGUILayout.Popup(verticaJloystick.intValue, s_inputListJoystickAxis.ToArray());
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.EndVertical();

        serializedObject.ApplyModifiedProperties();

        EditorGUILayout.LabelField("");
    }
Example #2
0
    void OnEnable()
    {
        // Setup the SerializedProperties.
        SeeInspector = serializedObject.FindProperty("SeeInspector");

        sensibilityJoystick    = serializedObject.FindProperty("sensibilityJoystick");
        animationCurveJoystick = serializedObject.FindProperty("animationCurveJoystick");

        horizontalJoystick = serializedObject.FindProperty("horizontalJoystick");
        verticaJloystick   = serializedObject.FindProperty("verticaJloystick");

        JoystickReticule myScript = (JoystickReticule)target;

        GameObject tmp = GameObject.Find("InputsManager");

        if (tmp)
        {
            objCanvasInput = tmp;
            for (var i = 0; i < tmp.GetComponent <MM_MenuInputs>().remapButtons[0].buttonsList.Count; i++)
            {
                s_inputListJoystickAxis.Add(tmp.GetComponent <MM_MenuInputs> ().remapButtons [0].buttonsList [i].name);
            }
            for (var i = 0; i < tmp.GetComponent <MM_MenuInputs>().remapButtons[1].buttonsList.Count; i++)
            {
                s_inputListJoystickButton.Add(tmp.GetComponent <MM_MenuInputs> ().remapButtons [1].buttonsList [i].name);
            }



            for (var i = 0; i < tmp.GetComponent <MM_MenuInputs>().remapButtons[2].buttonsList.Count; i++)
            {
                s_inputListKeyboardAxis.Add(tmp.GetComponent <MM_MenuInputs> ().remapButtons [2].buttonsList [i].name);
            }
            for (var i = 0; i < tmp.GetComponent <MM_MenuInputs>().remapButtons[3].buttonsList.Count; i++)
            {
                s_inputListKeyboardButton.Add(tmp.GetComponent <MM_MenuInputs> ().remapButtons [3].buttonsList [i].name);
            }
        }

        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_03 = MakeTex(2, 2, new Color(.3F, .9f, 1, .5f));
        Tex_04 = MakeTex(2, 2, new Color(1, .3f, 1, .3f));
        Tex_05 = MakeTex(2, 2, new Color(1, .5f, 0.3F, .4f));
    }
Example #3
0
    public bool initIngameGlobalManageVariables()
    {
        //Debug.Log("here Init");


        // LevelManager
        GameObject tmpObj = GameObject.Find("LevelManager");

        if (tmpObj)
        {
            _levelManager = tmpObj.GetComponent <LevelManager> ();
            saveAndLoadManager._levelManager = _levelManager;
        }

        // cameraViewer3D
        tmpObj = GameObject.Find("CamShowObject");
        if (tmpObj)
        {
            cameraViewer3D = tmpObj.GetComponent <investigationCam> ();
        }

        // canvasPlayerInfos
        tmpObj = GameObject.Find("Canvas_PlayerInfos");
        if (tmpObj)
        {
            canvasPlayerInfos = tmpObj.GetComponent <UIVariousFunctions> ();

            // Reticule
            tmpObj = GameObject.Find("Reticule");
            if (tmpObj)
            {
                if (!b_DesktopInputs)
                {               // Deactivate Reticule if Mobile input are used
                    tmpObj.SetActive(false);
                    reticule = null;
                }
                else
                {
                    tmpObj.SetActive(true);
                    reticule = tmpObj;
                }
            }

            tmpObj = GameObject.Find("ReticuleJoystick");
            if (tmpObj)
            {
                reticuleJoystick      = tmpObj;
                reticuleJoystickImage = reticuleJoystick.transform.GetChild(0);
                _joystickReticule     = reticuleJoystick.GetComponent <JoystickReticule>();

                if (!b_DesktopInputs && reticuleJoystickImage && reticuleJoystickImage.gameObject.activeSelf)
                {
                    reticuleJoystickImage.gameObject.SetActive(false);
                }
            }

            StartCoroutine(InitCanvasMenu());
        }



        // canvasMainMenu
        tmpObj = GameObject.Find("Canvas_MainMenu");
        if (tmpObj)
        {
            canvasMainMenu = tmpObj.GetComponent <Menu_Manager> ();
        }

        switchKeyboardJoystick();

        // canvasLoadingScreen
        tmpObj = GameObject.Find("Canvas_LoadingScreen");
        if (tmpObj)
        {
            canvasLoadingScreen = tmpObj.GetComponent <Menu_Manager> ();
        }

        // Game_ObjectReader
        tmpObj = GameObject.Find("Game_ObjectReaderConnect");
        if (tmpObj)
        {
            Game_ObjectReader = tmpObj.GetComponent <ObjectReaderConnect>().Game_ObjectReaderConnect.GetComponent <ingameMultiPageText> ();
        }

        // canvasMobileInputs
        GameObject tmpMobileCanvas = GameObject.Find("mobileCanvas");

        if (tmpMobileCanvas)
        {
            canvasMobileInputs = tmpMobileCanvas.GetComponent <canvasMobileConnect>().canvas_Mobile;
            if (b_DesktopInputs)
            {
                canvasMobileInputs.SetActive(false);
            }                                                                       // Deactivate Mobile canvas if Desktop input are used
            else
            {
                canvasMobileInputs.SetActive(true);
            }
        }

        lastUIButtonSelected = null;
        navigationButtonList.Clear();

        // Find the event System
        GameObject tmpEventSys = GameObject.Find("EventSystem");

        if (tmpEventSys)
        {
            eventSys = tmpEventSys.GetComponent <EventSystem> ();
        }

        // InitInputs

        initInputsValues();


        // inputListOfStringGamepad


        // audioMenu
        tmpObj = GameObject.Find("audioMenu");
        if (tmpObj)
        {
            audioMenu = tmpObj.GetComponent <AudioSource> ();
        }

        // audioMenuClips
        tmpObj = GameObject.Find("audioMenu");
        if (tmpObj)
        {
            audioMenuClips = tmpObj.GetComponent <audioMenuClipList> ();
        }


        // voiceOverManager
        tmpObj = GameObject.Find("VoiceOver_Manager");
        if (tmpObj)
        {
            voiceOverManager = tmpObj.GetComponent <VoiceOver_Manager> ();
        }



        currentPlayerDiaryList.Clear();
        currentPlayerInventoryList.Clear();
        currentPlayerInventoryObjectVisibleList.Clear();

        // Connect script mobileInputsFingerMovement to canvasMobileInputs
        if (GetComponent <mobileInputsFingerMovement> () && !b_DesktopInputs)
        {
            //Debug.Log ("Here Ok");
            if (canvasMobileInputs)
            {
                GetComponent <mobileInputsFingerMovement> ().m_Raycaster = canvasMobileInputs.GetComponent <GraphicRaycaster> ();
            }
            if (canvasPlayerInfos)
            {
                GetComponent <mobileInputsFingerMovement> ().listRaycaster[0] = canvasPlayerInfos.GetComponent <GraphicRaycaster> ();
            }
            if (canvasMobileInputs)
            {
                GetComponent <mobileInputsFingerMovement> ().listRaycaster[1] = canvasMobileInputs.GetComponent <GraphicRaycaster> ();
            }
            if (canvasMainMenu)
            {
                GetComponent <mobileInputsFingerMovement> ().listRaycaster[2] = canvasMainMenu.GetComponent <GraphicRaycaster> ();
            }
        }

        // currentPlayer
        b_bodyMovement = true;

        tmpObj = GameObject.Find("Character");
        if (tmpObj)
        {
            currentPlayer = tmpObj;
        }


        if (tmpMobileCanvas && tmpMobileCanvas.GetComponent <canvasMobileConnect> ())
        {
            tmpMobileCanvas.GetComponent <canvasMobileConnect>().initializedCanvasMobile();
        }

        gameObject.GetComponent <focusCamEffect> ().Init();



        // language Choice
        tmpObj = GameObject.Find("OptionsManager");
        if (tmpObj)
        {
            tmpObj.GetComponent <GameOptionsManager>().initData();
        }



        return(true);
    }
Example #4
0
    void Start()
    {
        DontDestroyOnLoad(gameObject);

        _focusCamEffect = gameObject.GetComponent <focusCamEffect>();

        // Reticule
        GameObject tmpObj = GameObject.Find("Reticule");

        if (tmpObj)
        {
            if (!b_DesktopInputs)                                       // Deactivate Reticule if Mobile input are used
            {
                tmpObj.SetActive(false);
                reticule = null;
            }
            else
            {
                tmpObj.SetActive(true);
                reticule = tmpObj;
            }
        }

        initIngameGlobalManageVariables();
        saveAndLoadManager.createListOfAllUITextInTheCurrentScene();


        tmpObj = GameObject.Find("ReticuleJoystick");
        if (tmpObj)
        {
            reticuleJoystick = tmpObj;

            reticuleJoystickImage = reticuleJoystick.transform.GetChild(0);
            _joystickReticule     = reticuleJoystick.GetComponent <JoystickReticule> ();
        }


        // canvasMobileInputs
        GameObject tmpMobileCanvas = GameObject.Find("mobileCanvas");

        if (tmpMobileCanvas)
        {
            canvasMobileInputs = tmpMobileCanvas.GetComponent <canvasMobileConnect>().canvas_Mobile;
            if (b_DesktopInputs)
            {
                canvasMobileInputs.SetActive(false);
            }                                                                        // Deactivate Mobile canvas if Desktop input are used
            else
            {
                canvasMobileInputs.SetActive(true);
            }
        }


        StartCoroutine("loadingData");


        //-> Objects in the LevelManager are Initialized when the scene start (Only on Editor Mode).
        if (Application.isEditor)
        {
            saveAndLoadManager.initLevelManagerObjectsUnityEditorOnly();
        }
    }