private void OnSceneChange(Scene oldScene, Scene newScene) { var playerMachine = Manager.Player.GetComponent <PlayerMachine>(); if (playerMachine) { modHUD.ToggleState(true, playerMachine); } else { if (modHUD) { modHUD.ToggleState(false, null); } } if (newScene.name == "void") { Basic_NPC spectralNpc = null; var npcs = Object.FindObjectsOfType <Basic_NPC>(); foreach (var npc in npcs) { var textAsset = npc.GetComponentInChildren <TalkVolume>().Dialogue; if (DialogueUtils.GetNPCName(textAsset.text) == "Oleia") { spectralNpc = npc; var collider = npc.GetComponentInChildren <Collider>(); if (collider) { npcDistance = collider.bounds.size.x; } break; } } if (spectralNpc != null) { LogDebug("Found Spectral!"); Object.Instantiate(spectralNpc, npcPos, Quaternion.identity); } } }
private void OnSceneChange(Scene oldScene, Scene newScene) { if (newScene.name == "void") { Basic_NPC legsNpc = null; var npcs = Object.FindObjectsOfType <Basic_NPC>(); foreach (var npc in npcs) { var textAsset = npc.GetComponentInChildren <TalkVolume>().Dialogue; if (DialogueUtils.GetNPCName(textAsset.text) == "Oleia") { legsNpc = npc; var collider = npc.GetComponentInChildren <Collider>(); if (collider) { npcDistance = collider.bounds.size.x; } break; } } if (legsNpc != null) { LogDebug("Found Oleia (Legs)!"); Object.Instantiate(legsNpc, npcPos, npcRot); } levelPos.Clear(); var boxes = GameObject.FindObjectsOfType <PizzaBox>(); foreach (var box in boxes) { string level = levelStr.GetValue(box) as string; if (level != null) { levelPos[level] = box.gameObject.transform.position; } } } }
private string Instance_OnParseScriptHook(string text) { string output = text; switch (DialogueUtils.GetNPCName(text)) { case "Oleia": var playerPos = Manager.Player.GetComponent <PlayerMachine>().transform.position; if (SceneManager.GetActiveScene().name == "void" && Vector3.Distance(npcPos, playerPos) <= npcDistance) { output = "%n10%v0%\r\nSpectral\r\n" + "%m1%Run%p11% %m0%%s.1%A%p8%l%p9%l %p10%%m1%N%p15%P%p16%Cs%p17%%sD%%p10%!\r\n\r\n%n\r\n"; } break; case "Denise": output = text.Replace(@"%v14", @"%v6"); break; } return(output); }