void Start() { if (tipScriptsList.Count != 0) { showingScript = tipScriptsList[tipCurrentlyAt]; } }
public Tip GenerateTip(TipScript tipScript) { Tip tip = Tip.CreateInstance <Tip>(); tip.DisplayText = tipScript.TipText; tip.ID = tipScript.GetInstanceID();//TipID; //If tips are enabled display if (TipsEnabled) { if (nothingDisplayed) { DisplayTip(tip); } else { listQueue.Add(tip); } }//Otherwise mark as seen (bypass and not be shown later) else { if (!nothingDisplayed) { //Get tip being displayed and disable //then mark as displayed tipHolder.gameObject.SetActive(false); } tip.WasDisplayed = true; } //Can be removed, does nothing so far return(tip); }
private void Tenth() { TipsControl control = gameObject.GetComponent <TipsControl>(); TipScript tip = gameObject.GetComponent <TipScript>(); control.GenerateTip(tip); checkMonitor.StartHintDisplay(); //StartCoroutine(DimElementsBut(noteUI, 1)); segment++;//= 11th Debug.Log("In tenth segment= " + segment); }
public void OnPreviousTip() { tipCurrentlyAt--; if (tipCurrentlyAt < 0) { Skip(); } else { showingScript.gameObject.SetActive(false); tipScriptsList[tipCurrentlyAt].gameObject.SetActive(true); showingScript = tipScriptsList[tipCurrentlyAt]; } }
public void OnNextTip() { tipCurrentlyAt++; if (tipCurrentlyAt > tipScriptsList.Count - 1) { Skip(); } else { showingScript.gameObject.SetActive(false); tipScriptsList[tipCurrentlyAt].gameObject.SetActive(true); showingScript = tipScriptsList[tipCurrentlyAt]; } }
// Start is called before the first frame update public void IKSetUp(int jointSum) { gameManager = GetComponent <GameManager>(); joints = new List <GameObject>(); jointScripts = new List <JointScript>(); slider = GameObject.Find("Slider"); sliderScript = slider.GetComponent <SliderScript>(); for (int i = 0; i < jointSum; i++) { AddJoint(i); } if (joints.Count <= 0) { return; } tip.transform.parent = joints[jointSum - 1].transform; tipScript = tip.GetComponent <TipScript>(); joints[0].transform.position = firstJointPoint; }
public void OnClickedHelp() { tipCurrentlyAt = 0; if (showingScript != null) { showingScript.gameObject.SetActive(false); } showingScript = tipScriptsList[0]; if (showingScript != null) { showingScript.gameObject.SetActive(true); } gameObject.SetActive(true); helpButton.SetActive(false); skipButton.SetActive(true); }
void Skip() //Skip will basically reset everything to be used again. { print("Skipped"); tipCurrentlyAt = 0; if (showingScript != null) { showingScript.gameObject.SetActive(false); } showingScript = tipScriptsList[0]; if (showingScript != null) { showingScript.gameObject.SetActive(true); } gameObject.SetActive(false); helpButton.SetActive(true); skipButton.SetActive(false); }
public override void Activate() { if (!isActive) { base.Activate(); security.ShowCones(); TipScript tip = gameObject.GetComponent <TipScript>();; tipControl.GenerateTip(tip); //Activate drop spot for tasks with drop spots DropItem di = gameObject.GetComponent <DropItem>(); //if dropppable object if (!task.IsCompleted) { foreach (DropSpot spot in di.TargetSpot) { //di.TargetSpot spot.gameObject.SetActive(true); } } } }
// Use this for initialization void Start() { startingHeight = 10; ResetMenuPosition(); playerInput = GameObject.FindGameObjectWithTag("Player").GetComponent<inputHandler>(); scoreScript = GameObject.FindGameObjectWithTag("MainUI").GetComponent<ScoreUIScript>(); tipsScript = gameObject.GetComponentInChildren<TipScript>(); HighScore = gameObject.GetComponentsInChildren<Text>()[0]; CurrentScore = gameObject.GetComponentsInChildren<Text>()[1]; }
/// <summary> /// Awake is called before Start /// </summary> void Start() { //If there is a task that comes with beginning of game //activate it Task task = gameObject.GetComponent <Task>(); if (task != null) { task.ActivateTask(); } string currenLvl = SceneManager.GetActiveScene().name; /*Game initilizer code works across scenes * check if the opening scene and set next level to main level * on the floor level puzzles will control if there'll * be another scene loaded in and what it is*/ //Load game save //LevelTraversal-> Set Active Scene //PlayerPosition -> Set Position //Puzzle Piece Manager -> SetPuzzles //Endings -> Set Flags if (currenLvl.Equals("Opening")) { //Hide mouse when starting game level LevelTraversal.TargetLevel = "FloorTest"; Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; //Debug.Log("d " + outline.GetComponent<cakeslice.Outline>().enabled); TipScript tip = Camera.main.GetComponents <TipScript>()[0]; gameObject.GetComponent <TipsControl>().GenerateTip(tip); TipScript tip2 = Camera.main.GetComponents <TipScript>()[1]; gameObject.GetComponent <TipsControl>().GenerateTip(tip2); TipScript tip3 = Camera.main.GetComponents <TipScript>()[2]; gameObject.GetComponent <TipsControl>().GenerateTip(tip3); } if (currenLvl.Equals("SubconscienceFloor")) { //Save when enter Subfloor string path = Application.persistentDataPath + "/save_info.sve"; if (File.Exists(path)) { SaveData data = SaveGame.LoadData(); Vector3 player = GameObject.FindGameObjectWithTag("Player").transform.position; player.x = data.PlayerPosition[0]; player.y = data.PlayerPosition[1]; player.z = data.PlayerPosition[2]; } elevatorAnim.Play("ElevatorOpen"); } if (currenLvl.Equals("AirVents")) { LevelTraversal.TargetLevel = "FloorTest"; } if (currenLvl.Equals("FloorTest")) { LevelTraversal.TargetLevel = "AirVents"; TipScript tip = Camera.main.GetComponents <TipScript>()[0]; gameObject.GetComponent <TipsControl>().GenerateTip(tip); TipScript tip2 = Camera.main.GetComponents <TipScript>()[1]; gameObject.GetComponent <TipsControl>().GenerateTip(tip2); TipScript tip3 = Camera.main.GetComponents <TipScript>()[2]; gameObject.GetComponent <TipsControl>().GenerateTip(tip3); } }