public override void Interact() { Debug.Log("Interacted"); Debug.Log(PlayerPrefs.GetString("CurrentTime")); if (PlayerPrefs.GetString("CurrentTime").StartsWith("Past") && !isPlaying) { isActive = GameObject.Find("Lever_Right").GetComponent <LeverRight>().activated; if (isActive) { Play(); } } else { if (!GameplayChecker.PianoPuzzleSolved) { InteractableManager = GameObject.Find("Interaction").GetComponent <InteractableManager>(); InteractableManager.pianoInteraction = this.gameObject; if (GameObject.Find("Piano")) { InteractableManager.Activate("Piano"); } } } }
/* Sets isDying and the trigger "makeBow" of the Animator attached to the same gameObject as this script, * if the given string matches "symptom". At a match this Victim instance is removed from InteractableManager. */ public void Rescue(string curedSymptom) { if (curedSymptom == symptom) { print("Succesfully rescued victim!"); string[] msg = { RESCUE_SUCCESS }; infoBox.DisplayInfo(msg); victimAnimCon.SetTrigger("makeBow"); bowAnimStart = Time.time; isDying = keepMeEnabled = true; InteractableManager intManager = GameObject.Find("Interactables").GetComponent <InteractableManager>(); intManager.RemoveInteractable(this); intManager.ResetInRangeInteractable(); } else { print("The chant did not cure this person!"); // victimAnimCon.SetTrigger("makeBow"); // FOR DEBUG! //bowAnimStart = Time.time; //isDying = keepMeEnabled = true; string[] msg = { RESCUE_FAIL }; infoBox.DisplayInfo(msg); /*InteractableManager intManager = GameObject.Find("Interactables").GetComponent<InteractableManager>(); // FOR DEBUG! * intManager.RemoveInteractable(this); * intManager.ResetInRangeInteractable();*/ } }
// Use this for initialization private void Start() { var manager = this.transform.GetComponent <InteractableManager>(); interactableManager = manager; interactionPanel.SetActive(false); }
public override IEnumerator Do(InteractableManager interactableManager, InventoryManager inventoryManager) { interactableManager.AddReaction(interactable, reaction); // Emoji animation time + a bit yield return(new WaitForSeconds(1.5f)); }
public ArrayList SpawnCharacters(ArrayList characters) { ArrayList characterclones = new ArrayList(); // Instantiate characters for (int i = 0; i < characters.Count && i < startChunk.spawnPoints.Count; ++i) { CharacterManager clone = (CharacterManager)Instantiate((CharacterManager)characters[i], ((Transform)startChunk.spawnPoints[i]).position, ((CharacterManager)characters[i]).transform.rotation); clone.LoadCharacterData(); clone.UpdateCharacter(); characterclones.Add(clone); } // Instantiate non playable characters foreach (Transform point in startChunk.personPoints) { InteractableManager random = RandomSelectInteractable(personPrefabsList); enemyList.Add(Instantiate(random, point.position, point.rotation)); } // Debug //foreach (CharacterManager character in characterclones) //{ // Debug.Log(character.ToString()); //} return(characterclones); }
public void HoverOnInteractable() { Camera c = Camera.main; RaycastHit hit; //Ray ray = new Ray(c.transform.position, c.transform.forward); Ray ray = c.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit, 100.0f)) { bool hitThisInteractable = hit.transform.GetInstanceID() == transform.GetInstanceID(); if (hitThisInteractable) { if (!isOnHover) { toggleHighlight(true); } isOnHover = true; if (Input.GetKeyDown(KeyCode.Return) || Input.GetMouseButtonDown(0)) { InteractableManager.showActions(this); } } else { if (isOnHover) { toggleHighlight(false); } isOnHover = false; } } }
public void clickOnInteractable() { return; if (PauseManager.isPaused == true) { return; } Camera c = Camera.main; if (Input.GetMouseButtonDown(0)) { RaycastHit hit; Ray ray = new Ray(c.transform.position, c.transform.forward); if (Physics.Raycast(ray, out hit, 100.0f)) { bool hitThisInteractable = hit.transform.GetInstanceID() == transform.GetInstanceID(); if (hitThisInteractable) { InteractableManager.showActions(this); } } } }
// Skip the current scene. Only works in Learn/reheasal mode. public static string skipScene(string input) { if (GameManager.Mode == GameMode.Rehearsal) { int actionsThisScene = InteractableLog.Count % InteractableConfig.ActionsPerSite; for (int i = 0 + actionsThisScene; i < InteractableConfig.ActionsPerSite; i++) { Debug.Log("Auto-performing action " + (i + 1)); InteractableManager.SetActiveInteractable(InteractablePath.NextInteractable, InteractablePath.NextAction); InteractableLog.Add(InteractablePath.NextInteractable, InteractablePath.NextAction); InteractablePath.GoToNextInteractable(); } return("Skiping scene"); } else if (GameManager.Mode == GameMode.Recall) { int actionsThisScene = InteractableLog.Count % InteractableConfig.ActionsPerSite; for (int i = 0 + actionsThisScene; i < InteractableConfig.ActionsPerSite; i++) { Debug.Log("Auto-performing action " + (i + 1)); InteractableLog.Add(InteractableManager.InteractableList[0], 0); } return("Skiping scene"); } return("Skip scene only supports Learn and Recal modes."); }
public override IEnumerator Do(InteractableManager interactableManager, InventoryManager inventoryManager) { CommandManager.QueueCommand(new IncrementProgress(0.25f)); return(null); ; }
public override IEnumerator Do(InteractableManager interactableManager, InventoryManager inventoryManager) { GameObject gameObject = GameObject.Find(gameObjectName); gameObject.transform.localPosition = targetPosition; return(null); }
List <string> interactableInInventory = new List <string>(); //List of all interactables in the player inventory //public List<string> menuActionList = new List<string>(); private void Awake() { gc = GetComponent <GameController>(); if (instance != null) { instance = this; } }
private void Awake() { ProjectileM = FindObjectOfType <ProjectileManager>(); EnemyM = FindObjectOfType <EnemyManager>(); ObjectM = FindObjectOfType <ObjectManager>(); PlayerM = FindObjectOfType <PlayerManager>(); InteractableM = FindObjectOfType <InteractableManager>(); IngameMenu = FindObjectOfType <GameMenu>(); }
// In learn mode, perform the next queued action public static string doNextAction(string input) { if (InteractablePath.NextInteractable != null && GameManager.Mode == GameMode.Rehearsal) { InteractableManager.SetActiveInteractable(InteractablePath.NextInteractable, InteractablePath.NextAction); InteractableLog.Add(InteractablePath.NextInteractable, InteractablePath.NextAction); InteractablePath.GoToNextInteractable(); } return("Performing next queued action"); }
private void InstantiateAndActivate() { InteractableManager = GameObject.Find("Interaction").GetComponent <InteractableManager>(); InteractableManager.picturesInteraction = this.gameObject; if (InteractableManager == null) { return; } playerAgent = GameObject.Find("Character(Clone)").GetComponent <NavMeshAgent>(); InteractableManager.Activate("Pictures"); }
public override void Interact() { if (!GameplayChecker.GramophonePuzzle) { interactableManager = GameObject.Find("Interaction").GetComponent <InteractableManager>(); interactableManager.gramophoneInteraction = this.gameObject; if (GameObject.Find("Gramophone")) { interactableManager.Activate("Gramophone"); } } }
/// <summary> Handles selecting Rehearsal Button </summary> public void Rehearsal() { GameManager.Mode = GameMode.Rehearsal; GameManager.State = GameState.Play; InteractablePathManager.InitalizePathAndLog(); InteractableManager.destroyInteractables(); Scene scene = SceneManager.GetActiveScene(); SceneManager.LoadScene(scene.name); }
private void Awake() { if (_instance == null) { _instance = this; } else { Debug.LogError("AN INSTANCE ALREADY EXISTS"); } ReadJSON.StartReadingJSON(); }
private void Awake() { DontDestroyOnLoad(gameObject); if (_instance == null) { _instance = this; } else { Destroy(gameObject); } }
// Start is called before the first frame update void Start() { m_playerManager = new PlayerUpdateManager(); for (int i = 0; i < k_maxPlayers; i++) { m_playerManager.RegisterNewPlayer(m_playerStartingPositions[i], i, m_playerStunUICovers[i]); } m_scoreManager = new ScoreManager(); m_interactManager = new InteractableManager(); }
public void DisplayPanel(SlotCard s) { InteractableManager.InteractableOff(); _as.Play(); Slot = s; Card = Slot.Card; panel.SetActive(true); SetCard(); SetBuyBTN(); SetBuildBTN(); }
public override void Interact() { if (!GameplayChecker.CraftedInvisiblityFlask) { interactableManager = GameObject.Find("Interaction").GetComponent <InteractableManager>(); interactableManager.craftInteraction = this.gameObject; if (GameObject.Find("AlchemyTable")) { interactableManager.Activate("AlchemyTable"); } } }
// Use this for initialization void Awake() { if (m_instance == null) { m_instance = this; } else { Destroy(gameObject); } m_referenceHolder = new GameObject("ReferenceHolder").transform; GetObjects(); }
public override void Interact() { //print("Picking up scroll with content " + info.content + " " + info.color); InteractableManager intManager = GameObject.Find("Interactables").GetComponent <InteractableManager>(); // So this scroll is not updated in InteractableManager intManager.RemoveInteractable(this); intManager.ResetInRangeInteractable(); Player player = GameObject.Find("Player").GetComponent <Player>(); player.inventory.AddScroll(this.info); Destroy(this.gameObject); }
private void Start() { GameManager.ResetCursor(); InteractableManager.Reset(); InteractablePathManager.Reset(); GameObject sideNav = GameObject.FindGameObjectWithTag("SideNav"); for (int i = 0; i < demoList.Length; i++) { Vector3 position = buttonOffset + new Vector3(0, -i * buttonPadding, 0); demoList[i].select = createLevelButton(demoList[i], sideNav.transform, position); } demoList[0].select.onClick.Invoke(); }
private void Start() { _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); _tileManager = ServiceLocator.Current.Get <TileManager>(); _interactableManager = ServiceLocator.Current.Get <InteractableManager>(); _gameLoopManager.OnPreparation += StopSpawning; _gameLoopManager.OnExecution += StartSpawning; _gameLoopManager.OnComplete += StopSpawning; _gameLoopManager.OnExecution += BakeNavMesh; _tileManager.OnRebakeMesh += BakeNavMesh; _tileManager.OnUpdateMesh += UpdateNavMesh; BakeNavMesh(); }
//Whenever the gramophone is clicked it initializes the unlock vinyls puzzle if it wasn't solved else it initializes the gramophone notes puzzle public override void Interact() { if (!GameplayChecker.GramophonePuzzle) { interactableManager = GameObject.Find("Interaction").GetComponent <InteractableManager>(); interactableManager.currentWindow = gameObject; if (GameplayChecker.GramophoneVinylsUnlockPuzzle) { interactableManager.Activate("Gramophone"); } else { interactableManager.Activate("Vinyl"); } } }
protected void Start() { interactableManager = ServiceLocator.Current.Get <InteractableManager>(); inputManager = ServiceLocator.Current.Get <InputManager>(); cameraManager = ServiceLocator.Current.Get <CameraManager>(); _gameLoopManager = ServiceLocator.Current.Get <GameLoopManager>(); audioManager = ServiceLocator.Current.Get <AudioManager>(); interactableManager.OnInteractableSelect += InteractableSelect; interactableManager.OnInteractableDeselect += InteractableDeselect; // _gameLoopManager.OnPreparation += ResetInteractable; _gameLoopManager.OnRestart += ResetInteractable; audioManager.OnAudioStop += StopAudio; ResetInteractable(); }
//------------------------------------------------------------------------- // CLASS METHOD DEFINITIONS //------------------------------------------------------------------------- void Awake() { manager = GetComponent <InteractableManager>(); manager.Register(this); updateHandler_ = sceneIntro; // play the cell door sound CellDoorSoundSound.Play(); // play background music but set volume to 0. // also set the fader for the bgm BackgroundMusic.Play(); BackgroundMusic.Loop(true); BackgroundMusic.SetVolume(0.0f); bgmFader_ = new Fader(0.0f, 30.0f, 0.0f); // introBgFader_ = new Fader(1.0f, 0.0f, 5.0f); }
public void CheckForButtonDown() { if (buttonPressed && !progressCompleted) { time += Time.deltaTime; if (time >= 0.2f) { float progressPosition = 360 * (-1 + (time - 0.2f / 1.0f)); RectTransform progressTransform = progress.GetComponent <RectTransform>(); progressTransform.offsetMax = new Vector2(progressPosition, progressTransform.offsetMax.y); if (time >= 1.2f) { if (GameManager.Mode == GameMode.Rehearsal) { if (interactable.ID == InteractablePath.NextInteractable.ID && actionIndex == InteractablePath.NextAction) { InteractableManager.SetActiveInteractable(interactable, actionIndex); interactable.SelectAction(actionIndex); InteractablePath.GoToNextInteractable(); } } else { interactable.SelectAction(actionIndex); } progressCompleted = true; progressTransform.offsetMax = new Vector2(-360, progressTransform.offsetMax.y); time = 0.0f; } } } else { RectTransform progressTransform = progress.GetComponent <RectTransform>(); progressTransform.offsetMax = new Vector2(-360, progressTransform.offsetMax.y); time = 0.0f; EventSystem.current.SetSelectedGameObject(null); } }
public override void onRaycastEnter() { if (_dialogShowing) { _dialogTimeout = Timeout; return; } if (_interactableElement == null) { _interactableElement = Instantiate(InteractElement, InteractInstanciationPosition); } InteractableManager interactableManager = _interactableElement.gameObject.GetComponentInChildren <InteractableManager>(); interactableManager.SetInteractableName(npcData.Name); interactableManager.StartInteractable(); _interactableShowing = true; _interactableTimeout = Timeout; }
void Awake() { manager = GetComponent<InteractableManager>(); manager.Register(this); }
//------------------------------------------------------------------------- // CLASS METHOD DEFINITIONS //------------------------------------------------------------------------- void Awake() { manager = GetComponent<InteractableManager>(); manager.Register(this); updateHandler_ = sceneIntro; // play the cell door sound CellDoorSoundSound.Play(); // play background music but set volume to 0. // also set the fader for the bgm BackgroundMusic.Play(); BackgroundMusic.Loop(true); BackgroundMusic.SetVolume(0.0f); bgmFader_ = new Fader(0.0f, 30.0f, 0.0f); // introBgFader_ = new Fader(1.0f, 0.0f, 5.0f); }
void Awake() { Instance = this; ParentObject = new GameObject("ParentObject"); }
//------------------------------------------------------------------------- public void Register(InteractableManager manager) { this.manager = manager; }