// 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 <---- }
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(""); AP_.DragAndDrop myScript = (AP_.DragAndDrop)target; EditorGUILayout.BeginVertical(style_Orange); EditorGUILayout.HelpBox("Select local Z distance between the selected object and the camera.", MessageType.Info); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Distance from the camera : ", GUILayout.Width(170)); EditorGUILayout.PropertyField(distanceFromTheCamera, new GUIContent("")); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); EditorGUILayout.HelpBox("Play a sound when an Object is selected or deselected.", MessageType.Info); EditorGUILayout.BeginHorizontal(); GUILayout.Label("AudioSource : ", GUILayout.Width(170)); EditorGUILayout.PropertyField(a_TakeObject, new GUIContent("")); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginVertical(style_Orange); EditorGUILayout.HelpBox("Choose the gamepad button used to selected a puzzle object.", MessageType.Info); if (objCanvasInput) { EditorGUILayout.BeginHorizontal(); GUILayout.Label("Validation Button Joystick : ", GUILayout.Width(170)); validationButtonJoystick.intValue = EditorGUILayout.Popup(validationButtonJoystick.intValue, s_inputListJoystickButton.ToArray()); EditorGUILayout.EndHorizontal(); } else { EditorGUILayout.HelpBox("INFO : The Object InputsManager needs to be activated in the the Hierarchy (Hierarchy : Canvas_MainMenu -> p_Inputs -> inputsManager", MessageType.Warning); } EditorGUILayout.EndVertical(); EditorGUILayout.LabelField(""); serializedObject.ApplyModifiedProperties(); }
void OnEnable() { // Setup the SerializedProperties. SeeInspector = serializedObject.FindProperty("SeeInspector"); validationButtonJoystick = serializedObject.FindProperty("validationButtonJoystick"); a_TakeObject = serializedObject.FindProperty("a_TakeObject"); distanceFromTheCamera = serializedObject.FindProperty("distanceFromTheCamera"); AP_.DragAndDrop myScript = (AP_.DragAndDrop)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)); }