void OnEnable() { // Setup the SerializedProperties. SeeInspector = serializedObject.FindProperty("SeeInspector"); speed = serializedObject.FindProperty("speed"); speedJoystick = serializedObject.FindProperty("speedJoystick"); animationCurveJoystick = serializedObject.FindProperty("animationCurveJoystick"); mobileSpeedRotation = serializedObject.FindProperty("mobileSpeedRotation"); horizontalJoystick = serializedObject.FindProperty("horizontalJoystick"); verticaJloystick = serializedObject.FindProperty("verticaJloystick"); investigationCam myScript = (investigationCam)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)); }
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; investigationCam myScript = (investigationCam)target; EditorGUILayout.HelpBox("This script allow to setup the 3D Viewer turntable behaviour", MessageType.Info); //--> Mouse Options EditorGUILayout.BeginVertical(style_Orange); EditorGUILayout.HelpBox("Keyboard and Mouse Options", MessageType.Info); //-> Mouse speed EditorGUILayout.BeginHorizontal(); GUILayout.Label("Mouse Speed : ", GUILayout.Width(120)); EditorGUILayout.PropertyField(speed, new GUIContent("")); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); //--> Joystick EditorGUILayout.BeginVertical(style_Orange); EditorGUILayout.HelpBox("Joystick Options", MessageType.Info); //-> Animation Curve EditorGUILayout.BeginHorizontal(); GUILayout.Label("Animation Curve : ", GUILayout.Width(120)); EditorGUILayout.PropertyField(animationCurveJoystick, new GUIContent("")); EditorGUILayout.EndHorizontal(); //-> Joystick speed EditorGUILayout.BeginHorizontal(); GUILayout.Label("Joystick Speed : ", GUILayout.Width(120)); EditorGUILayout.PropertyField(speedJoystick, new GUIContent("")); EditorGUILayout.EndHorizontal(); if (objCanvasInput) { //-> Joystick Input to move Horizontaly EditorGUILayout.BeginHorizontal(); GUILayout.Label("Horizontal : ", GUILayout.Width(120)); horizontalJoystick.intValue = EditorGUILayout.Popup(horizontalJoystick.intValue, s_inputListJoystickAxis.ToArray()); EditorGUILayout.EndHorizontal(); //-> Joystick Input to move verticaly EditorGUILayout.BeginHorizontal(); GUILayout.Label("Vertical : ", GUILayout.Width(120)); verticaJloystick.intValue = EditorGUILayout.Popup(verticaJloystick.intValue, s_inputListJoystickAxis.ToArray()); EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); //--> Mobile Options EditorGUILayout.BeginVertical(style_Orange); EditorGUILayout.HelpBox("Mobile", MessageType.Info); //--> Mobile Rotation Speed EditorGUILayout.BeginHorizontal(); GUILayout.Label("Speed : ", GUILayout.Width(120)); EditorGUILayout.PropertyField(mobileSpeedRotation, new GUIContent("")); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); serializedObject.ApplyModifiedProperties(); EditorGUILayout.LabelField(""); }
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); }