public void Start() { keyReference1 = GameObject.Find("Crystal_01").GetComponent <InteractKey>(); keyReference2 = GameObject.Find("Crystal_02").GetComponent <InteractKey>(); keyReference3 = GameObject.Find("Crystal_03").GetComponent <InteractKey>(); }
private void ProcessLines() { while (Dist(Interrogator, Interrogee) > DistanceToStart) { GameFiber.Yield(); } Interrogator.KeepTasks = true; Interrogee.KeepTasks = true; NativeFunction.Natives.TASK_TURN_PED_TO_FACE_ENTITY(Game.LocalPlayer.Character, Interrogee, -1); NativeFunction.Natives.TASK_TURN_PED_TO_FACE_ENTITY(Interrogee, Game.LocalPlayer.Character, -1); GameFiber.Sleep(1000); _playerTOsus = CreatePointingCam(Interrogator, Interrogee); _susTOplayer = CreatePointingCam(Interrogee, Interrogator); Interrogator.IsPositionFrozen = true; Interrogee.IsPositionFrozen = true; _gameCam = CreateGameCam(); NativeFunction.Natives.SET_PED_CAN_SWITCH_WEAPON(Interrogator, false); while (true) { GameFiber.Yield(); if (_lines[_currentLine].LineType != _lineTypeCheck) { _currentLine++; continue; } Game.DisplayHelp("Press ~y~" + InteractKey.ToString() + "~w~ to continue the interrogation."); while (true) { GameFiber.Yield(); if (!Game.IsKeyDown(InteractKey)) { continue; } Game.HideHelp(); break; } var cl = _lines[_currentLine]; Interrogee.IsVisible = false; PedPlayRndAnim(Interrogator); PlayFacialAnim(Interrogator); DisplayLineForPed(Interrogator, cl.PlayerLine, _susTOplayer); Interrogee.IsVisible = true; Interrogator.IsVisible = false; PedPlayRndAnim(Interrogee); PlayFacialAnim(Interrogee); DisplayLineForPed(Interrogee, cl.PerpLine, _playerTOsus); if (cl.LineType == InterrogationLine.Type.Question) { PlayInterrogeeFacialAnim(cl.CorrectType, Interrogee); Game.DisplayHelp(Help, true); _lineTypeCheck = WaitForPlayersResponse(cl.CorrectType); } else { _lineTypeCheck = InterrogationLine.Type.Question; } Interrogee.Tasks.Clear(); Interrogator.IsVisible = true; _currentLine++; if (_currentLine == _lines.Length) { break; } } }
public void Start() { // Return the current Active Scene in order to get the current Scene name. scene = SceneManager.GetActiveScene(); keyReference = GameObject.Find("key").GetComponent <InteractKey>(); }