//This script has to run the timer to get the right duration for the no path found error. //Also, variables are sent to other scripts. public void Update() { //Send model selection to other scripts modelName = modelLoad; HierarchyManager hierarchyManager = GameObject.Find("InspectionManager").GetComponent <HierarchyManager>(); InspectionButtons inspectionButtons = GameObject.Find("InspectionManager").GetComponent <InspectionButtons>(); CoordinatesInput coordinatesInput = GameObject.Find("ImageTarget/" + modelName + "(Clone)/default").GetComponent <CoordinatesInput>(); hierarchyManager.GetModelName(modelName); inspectionButtons.GetModelName(modelName); coordinatesInput.GetModelName(modelName); //Send model selection to scripts of number objects (responsible for creating the marking tag) numbersObjects = GameObject.FindGameObjectsWithTag("Number"); for (int i = 0; i < numbersObjects.Length - 1; i++) { NumberValue numberValue = numbersObjects[i].GetComponent <NumberValue>(); numberValue.GetModelName(modelName); } pathList = path; //Timer to let popup wait between active and inactive if (timer >= 0) { timer = timer - Time.deltaTime; } if (timer < 0) { timer = 3; noPathPopUp.SetActive(false); } }
//Get the marking tag each frame public void Update() { //Get the number from the display within the Add Window markingTag = numberDisplay.GetComponent <TextMeshPro>().text; //Send variables to other scripts HierarchyManager hierarchyManager = GameObject.Find("InspectionManager").GetComponent <HierarchyManager>(); hierarchyManager.GetMarkingTag(markingTag); NewLoadSave newLoadSave = GameObject.Find("InspectionManager").GetComponent <NewLoadSave>(); newLoadSave.GetMarkingTag(markingTag); CoordinatesInput coordinatesInput = GameObject.Find("ImageTarget/" + modelName + "(Clone)/default").GetComponent <CoordinatesInput>(); coordinatesInput.GetMarkingTag(markingTag); }
public void ButtonChanges() { spawnComponent = GameObject.Find("ImageTarget/" + modelName + "(Clone)/default"); //Find GameObject within parent with script spawnScript = spawnComponent.GetComponent <CoordinatesInput>(); //Assign nose cone script variable if (startBool == true && changesBool == false) { startBool = false; changesBool = true; for (int i = 0; i < nonChangesButtons.Length; i++) //Set all non changes buttons INactive { nonChangesButtons[i].SetActive(false); } spawnScript.ChangesToggled(changesBool); //Send bool variable to nose cone script return; } if (startBool == false && changesBool == true) { startBool = true; changesBool = false; for (int i = 0; i < nonChangesButtons.Length; i++) //Set all non changes buttons Active { nonChangesButtons[i].SetActive(true); } spawnScript.ChangesToggled(changesBool); return; } else { startBool = true; changesBool = false; for (int i = 0; i < nonChangesButtons.Length; i++) { nonChangesButtons[i].SetActive(true); } spawnScript.ChangesToggled(changesBool); } }