private void Start () { if (GameObject.FindWithTag (Tags.persistentEngine) && GameObject.FindWithTag (Tags.persistentEngine).GetComponent <StateHandler>()) { stateHandler = GameObject.FindWithTag (Tags.persistentEngine).GetComponent <StateHandler>(); } if (GameObject.FindWithTag (Tags.persistentEngine) && GameObject.FindWithTag (Tags.persistentEngine).GetComponent <RuntimeInventory>()) { runtimeInventory = GameObject.FindWithTag (Tags.persistentEngine).GetComponent <RuntimeInventory>(); } if (GameObject.FindWithTag (Tags.persistentEngine) && GameObject.FindWithTag (Tags.persistentEngine).GetComponent <PlayerMenus>()) { playerMenus = GameObject.FindWithTag (Tags.persistentEngine).GetComponent <PlayerMenus>(); } }
private void OnDestroy () { firstPersonCamera = null; playerInput = null; settingsManager = null; sceneSettings = null; playerMenus = null; navigationManager = null; }
private void Start () { AssignFPCamera (); playerMenus = GameObject.FindWithTag (Tags.persistentEngine).GetComponent <PlayerMenus>(); runtimeInventory = playerMenus.GetComponent <RuntimeInventory>(); }
public override void RecalculateSize () { if (Application.isPlaying) { if (GameObject.FindWithTag (Tags.gameEngine)) { dialog = GameObject.FindWithTag (Tags.gameEngine).GetComponent <Dialog>(); } if (GameObject.FindWithTag (Tags.persistentEngine)) { playerMenus = GameObject.FindWithTag (Tags.persistentEngine).GetComponent <PlayerMenus>(); } } base.RecalculateSize (); }
public override string GetLabel (int slot) { if (labelType == AC_LabelType.Normal) { return TranslateLabel (label); } else if (labelType == AC_LabelType.DialogueSpeaker) { if (dialog == null) { dialog = GameObject.FindWithTag (Tags.gameEngine).GetComponent <Dialog>(); } return dialog.GetSpeaker (); } else if (labelType == AC_LabelType.DialoguePortrait) { if (dialog == null) { dialog = GameObject.FindWithTag (Tags.gameEngine).GetComponent <Dialog>(); } return dialog.GetSpeaker (); } else if (labelType == AC_LabelType.GlobalVariable) { return RuntimeVariables.GetVariable (variableID).GetValue (); } else if (labelType == AC_LabelType.Hotspot) { if (playerMenus == null) { playerMenus = GameObject.FindWithTag (Tags.persistentEngine).GetComponent <PlayerMenus>(); } return playerMenus.GetHotspotLabel (); } return ""; }
/** * <summary>Unsets the values of all script variables, so that they can be re-assigned to the correct scene if multiple scenes are open.</summary> */ public void ClearVariables() { playerPrefab = null; mainCameraPrefab = null; persistentEnginePrefab = null; gameEnginePrefab = null; // Managers sceneManagerPrefab = null; settingsManagerPrefab = null; actionsManagerPrefab = null; variablesManagerPrefab = null; inventoryManagerPrefab = null; speechManagerPrefab = null; cursorManagerPrefab = null; menuManagerPrefab = null; // PersistentEngine components optionsComponent = null; runtimeInventoryComponent = null; runtimeVariablesComponent = null; playerMenusComponent = null; stateHandlerComponent = null; sceneChangerComponent = null; saveSystemComponent = null; levelStorageComponent = null; runtimeLanguagesComponent = null; // GameEngine components menuSystemComponent = null; dialogComponent = null; playerInputComponent = null; playerInteractionComponent = null; playerMovementComponent = null; playerCursorComponent = null; playerQTEComponent = null; sceneSettingsComponent = null; navigationManagerComponent = null; actionListManagerComponent = null; localVariablesComponent = null; menuPreviewComponent = null; SetGameEngine (); }
private void GetReferences () { settingsManager = AdvGame.GetReferences ().settingsManager; if (settingsManager != null && settingsManager.IsInLoadingScene ()) { return; } playerCursor = GameObject.FindWithTag (Tags.gameEngine).GetComponent <PlayerCursor>(); playerInput = playerCursor.GetComponent <PlayerInput>(); playerInteraction = playerCursor.GetComponent <PlayerInteraction>(); playerMovement = playerCursor.GetComponent <PlayerMovement>(); dialog = playerCursor.GetComponent <Dialog>(); playerMenus = GetComponent <PlayerMenus>(); actionListManager = playerCursor.GetComponent <ActionListManager>(); dragBases = FindObjectsOfType (typeof (DragBase)) as DragBase[]; hotspots = FindObjectsOfType (typeof (Hotspot)) as Hotspot[]; arrowPrompts = FindObjectsOfType (typeof (ArrowPrompt)) as ArrowPrompt[]; parallax2Ds = FindObjectsOfType (typeof (Parallax2D)) as Parallax2D[]; }
private void OnDestroy () { playerInput = null; playerCursor = null; playerMenus = null; playerInteraction = null; playerMovement = null; settingsManager = null; arrowPrompts = null; hotspots = null; actionListManager = null; dialog = null; }
private void OnDestroy () { stateHandler = null; runtimeInventory = null; playerInput = null; playerInteraction = null; playerMenus = null; }