// 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 <---- }
}; // 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 <---- }
}; // 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 <---- }
// 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>(); }
}; // 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 <---- }
// Use this for initialization void Start() { audioVarious = new audioVariousFunctions(); GameObject tmpObj = GameObject.Find("UI_Infos"); if (tmpObj) { info = tmpObj.GetComponent <infoUI> (); } _audio = GetComponent <AudioSource> (); if (checkFocusMode()) { camManager = GetComponent <focusCamEffect> (); } //-> Rotation case if (movementType == 0) { hinge = objPivot.GetComponent <HingeJoint> (); // init hinge joint motor = hinge.motor; limits = hinge.limits; doorInitialization(); rb = objPivot.GetComponent <Rigidbody> (); rb.collisionDetectionMode = CollisionDetectionMode.Discrete; rb.isKinematic = true; } //-> Translation Case if (movementType == 1) { rb = targetPos.GetComponent <Rigidbody> (); initAxisConstraints(); rb.mass = _rbMass; } tmpObj = GameObject.Find("VoiceOver_Manager"); if (tmpObj) { voiceOverManager = tmpObj.GetComponent <VoiceOver_Manager> (); } }
//--> Check when focus ended. Then Check if the puzzle could be activated private IEnumerator checkEnterFocusEnded(bool b_StartFocus) { if (b_StartFocus) { focusCamEffect _focus = ingameGlobalManager.instance.GetComponent <focusCamEffect>(); yield return(new WaitUntil(() => _focus.b_MovementEnded == false)); yield return(new WaitUntil(() => _focus.b_MovementEnded == true)); } checkIfPuzzleIsAvailable(); ingameGlobalManager.instance.currentPuzzle = GetComponent <conditionsToAccessThePuzzle>(); if (b_PuzzleIsActivated) { if (!gameObject.GetComponent <focusOnly>() && ingameGlobalManager.instance.b_Joystick) { ingameGlobalManager.instance._joystickReticule.newPosition(Screen.width / 2, Screen.height / 2); ingameGlobalManager.instance.reticuleJoystickImage.gameObject.SetActive(true); } if (gameObject.GetComponent <AP_.DragAndDrop>()) { ingameGlobalManager.instance.b_dragAndDropActivated = true; } } //b_FocusEnded = true; yield return(null); }
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(); } }
public override void OnInspectorGUI() { if (SeeInspector.boolValue) // If true Default Inspector is drawn on screen { DrawDefaultInspector(); } serializedObject.Update(); focusCamEffect myScript = (focusCamEffect)target; 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; //focusCamEffectEditor myScript = (focusCamEffectEditor)target; EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("This Object is not the ingameGlobalManager :", GUILayout.Width(250)); EditorGUILayout.PropertyField(b_Child, new GUIContent("")); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginVertical(style_Purple); if (b_Child.boolValue) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Target Focus Camera :", GUILayout.Width(220)); EditorGUILayout.PropertyField(targetFocusCamera, new GUIContent("")); EditorGUILayout.EndHorizontal(); if (targetFocusCamera.objectReferenceValue) { if (GUILayout.Button("Create Test Camera")) { GameObject camtest = new GameObject(); camtest.name = "camTest"; camtest.AddComponent <Camera>(); camtest.transform.SetParent(myScript.targetFocusCamera.transform); camtest.transform.localPosition = Vector3.zero; camtest.transform.localEulerAngles = Vector3.zero; camtest.GetComponent <Camera>().fieldOfView = 50; camtest.GetComponent <Camera>().nearClipPlane = 0.05f; Undo.RegisterCreatedObjectUndo(camtest, "camtest"); Selection.activeTransform = camtest.transform.parent.transform; } } if (myScript.targetFocusCamera && myScript.targetFocusCamera.transform.childCount > 0 && myScript.targetFocusCamera.transform.GetChild(0).name == "camTest") { if (GUILayout.Button("Delete Test Camera")) { Undo.DestroyObjectImmediate(myScript.targetFocusCamera.transform.GetChild(0).gameObject); } } } else { /* EditorGUILayout.BeginHorizontal(); * EditorGUILayout.LabelField("Offset Acceleration to reach end position :", GUILayout.Width(240)); * EditorGUILayout.PropertyField(refOffset, new GUIContent("")); * EditorGUILayout.EndHorizontal(); * * EditorGUILayout.BeginHorizontal(); * EditorGUILayout.LabelField("Movement speed :", GUILayout.Width(150)); * EditorGUILayout.PropertyField(speed, new GUIContent("")); * EditorGUILayout.EndHorizontal(); */ EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("AudioSource :", GUILayout.Width(150)); EditorGUILayout.PropertyField(_audio, new GUIContent(""), GUILayout.Width(100)); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Focus In :", GUILayout.Width(150)); EditorGUILayout.PropertyField(a_FocusIn, new GUIContent(""), GUILayout.Width(100)); EditorGUILayout.LabelField("vol :", GUILayout.Width(30)); EditorGUILayout.PropertyField(volume_FocusIn, new GUIContent("")); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Focus Out :", GUILayout.Width(150)); EditorGUILayout.PropertyField(a_FocusOut, new GUIContent(""), GUILayout.Width(100)); EditorGUILayout.LabelField("vol :", GUILayout.Width(30)); EditorGUILayout.PropertyField(volume_FocusOut, new GUIContent("")); EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); serializedObject.ApplyModifiedProperties(); }