void OnTriggerExit(Collider c) { var holdableExit = c.GetComponent <Holdable>(); if (holdableExit != null) { holdableExit.ResetColor(); } if (c.GetComponent <Holdable>() != null) { holdable = null; } if (c.GetComponent <Button>() != null) { button = null; } var sliderExit = c.transform.parent.parent.GetComponent <SliderScript>(); if (currentSliders.Contains(sliderExit)) { currentSliders.Remove(sliderExit); } if (currentSliders.Count > 0) { slider = currentSliders[0]; } else { slider = null; } }
// Start is called before the first frame update void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>(); SC = GameObject.FindObjectOfType <SliderScript>(); PM = GameObject.FindObjectOfType <playerMovement>(); Instantiate(BossBullet, bulletPoint.position, Quaternion.identity); }
private void Start() { audioSource = gameObject.GetComponent <AudioSource>(); sliderScript = GameObject.Find("Slider").GetComponent <SliderScript>(); hints = GameObject.Find("Hints").GetComponent <Text>(); Cursor.lockState = CursorLockMode.Locked; }
private void SelectModel() { ResetAll(); gameObject.SetActive(true); x = transform.localPosition.x; y = transform.localPosition.y; z = transform.localPosition.z; Debug.Log(x + ", " + y + ", " + z); scaleX = transform.localScale.x; scaleY = transform.localScale.y; scaleZ = transform.localScale.z; existingRotation = transform.rotation; if (PositionDictionary.Data.ContainsKey(gameObject.name)) { transform.localPosition = PositionDictionary.Data[gameObject.name]; } else { transform.localPosition = new Vector3(0.0f, y, 0.0f); } ResetButtonScript.SetModelPosition(UnselectModel); SliderScript.SetTextData(gameObject.name); leanScaleScript.enabled = true; if (capsuleObject) { capsuleObject.SetActive(false); } }
void Start() { paused = false; nav = GetComponent <UnityEngine.AI.NavMeshAgent>(); ssRef = slider.GetComponent <SliderScript>(); status = Status.WAITING_IN_QUEUE; tip = (int)Random.Range(tipRange.x, tipRange.y); }
void Awake() { if (popupNewspaper) { newspaperSlide = GameObject.FindGameObjectWithTag("NewspaperSlide").GetComponent <SliderScript>(); } Invoke("DelayInvoke", (10)); }
// initialize by getting the script from the slider game object void Awake() { this._Slscrpt = transform.FindChild("ProfileText").FindChild("Level").FindChild("Slider").GetComponent <SliderScript> (); this.ProfileImage = transform.FindChild("ProfilePicture").FindChild("PictureSquare").FindChild("Image").GetComponent <Image> (); this.NameField = transform.FindChild("ProfileText").FindChild("Name").GetComponent <Text> (); this.DailyScoreField = transform.FindChild("ProfileText").FindChild("DailyScore").GetComponent <Text> (); this.TotalScoreField = transform.FindChild("ProfileText").FindChild("TotalScore").GetComponent <Text> (); }
private void Awake() { DontDestroyOnLoad(this); instance = this; Island.LevelOver += ShowWinnerPanel; sliderScript = GetComponentInChildren <SliderScript>(); WinPanel = transform.GetChild(1).gameObject; }
void Push() { if (Controller.control) { SliderScript sl = Slider.GetComponent <SliderScript>(); EventSystem.SendMessage("checkAnswer", sl.getP()); } }
public void BeginChangingValueDisplayed(SliderScript newSliderScript) { if (changingValueDisplayedCoroutine == null) { sliderScript = newSliderScript; changingValueDisplayedCoroutine = ChangingValueDisplayedCoroutine(); StartCoroutine(changingValueDisplayedCoroutine); } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { GameFlow = animator.GetComponent <GameFlow>(); Scene = GameFlow.CurrentLoadingScene != null ? GameFlow.CurrentLoadingScene : Scene; sceneAO = SceneManager.LoadSceneAsync(Scene); Slider = GameFlow.LoadingMask.GetComponent <SliderScript>(); Slider.Rest(); GameFlow.LoadingMask.SetActive(true); }
public void BeginMovingArrow(SliderScript newSliderScript) { if (movingArrowCoroutine == null) { sliderScript = newSliderScript; movingArrowCoroutine = MovingArrowCoroutine(); StartCoroutine(movingArrowCoroutine); } }
void unselectButton() { if (selectedSlider) { selectedSlider = null; } selected.localScale = selectedScale; selected = null; timer = 0; }
// Start is called before the first frame update void Start() { sliderScript = GetComponent <SliderScript>(); spawnPos = spawnPoint.position; spawnRot = spawnPoint.rotation; CubeController.gm = this; int thirdOfPop = Mathf.RoundToInt(spawnNum * 0.3f); childPopSize = (thirdOfPop % 2 == 1) ? thirdOfPop + 1 : thirdOfPop; UpdateText(); }
void Awake() { if (instans == null) { instans = this; } else { DestroyImmediate(this); } }
private void UnselectModel() { ResetAll(); transform.localPosition = new Vector3(x, y, z); transform.rotation = existingRotation; transform.localScale = new Vector3(scaleX, scaleY, scaleZ); ResetButtonScript.DisableButton(); SliderScript.DisableSlider(); leanScaleScript.enabled = false; if (capsuleObject) { capsuleObject.SetActive(true); } }
public void generate() { int value = SliderScript.getSliderValue(); TotalScript.setTotalValue(-value); for (int i = 0; i < value; i++) { Text t = WoodenBoxesScript.getNumberBoxValue(i); t.text = (Random.Range(0, 10)).ToString(); } TotalScript.setLocked(false); turno++; turnoText.text = "Turnos decorridos: " + turno.ToString(); GameController.setTurnoValue(turno); }
void Awake() { sliders = GameObject.Find("SlidersPanel").GetComponent <SliderScript> (); nameValidator = GameObject.Find("NamePanel").GetComponent <NameValidator> (); activeBodypartSelector = GameObject.Find("ActiveBodypartPanel").GetComponent <ActiveBodypartSelector>(); saveButton = GameObject.Find("SaveButton").GetComponent <Button> (); nameInputField = GameObject.Find("NameInputField").GetComponent <InputField> (); move = new Move(); move.SetActiveBodypart("Head"); twistLimitMarkers = new List <GameObject> (); twistLimitMarkers.Add(GameObject.Find("HighFrameLimitMarker")); twistLimitMarkers.Add(GameObject.Find("LowFrameLimitMarker")); twistLimitMarkers.Add(GameObject.Find("HighHardLimitMarker")); twistLimitMarkers.Add(GameObject.Find("LowHardLimitMarker")); }
private void Start() { source = GetComponent <AudioSource>(); if (Application.loadedLevelName == "GameScene") { newspaperSlide = GameObject.FindGameObjectWithTag("NewspaperSlide").GetComponent <SliderScript>(); noteSlide = GameObject.FindGameObjectWithTag("NoteSlide").GetComponent <SliderScript>(); photoBoy = GameObject.FindGameObjectWithTag("PhotoBoySlide").GetComponent <SliderScript>(); photoCerys = GameObject.FindGameObjectWithTag("PhotoCerysSlide").GetComponent <SliderScript>(); photoSusan = GameObject.FindGameObjectWithTag("PhotoSusanSlide").GetComponent <SliderScript>(); photoBoyScratched = GameObject.FindGameObjectWithTag("PhotoBoySlide").GetComponent <SwitchSprite>(); photoCerysScratched = GameObject.FindGameObjectWithTag("PhotoCerysSlide").GetComponent <SwitchSprite>(); photoSusanScratched = GameObject.FindGameObjectWithTag("PhotoSusanSlide").GetComponent <SwitchSprite>(); gameBG = GameObject.FindGameObjectWithTag("GameBG").GetComponent <SwitchSprite>(); boxFall = GameObject.FindGameObjectWithTag("BoxFall").GetComponent <SwitchSprite>(); laptop = GameObject.FindGameObjectWithTag("LaptopStatic").GetComponent <Animator>(); tlLight = GameObject.FindGameObjectWithTag("TL Light"); lpLight = GameObject.FindGameObjectWithTag("LaptopLight"); creepWindow = GameObject.FindGameObjectWithTag("CreepWindow"); creepEndGame = GameObject.FindGameObjectWithTag("CreepEndGame"); creepEndGame.SetActive(false); creepWindow.SetActive(false); lpLight.SetActive(lpLightActive); if (GameManager.laptopOff) { laptop.Play("laptopOff"); } if (GameManager.stage >= 6) { photoBoyScratched.NewSprite(3); photoCerysScratched.NewSprite(3); photoSusanScratched.NewSprite(3); gameBG.NewSprite(4); } } else if (Application.loadedLevelName == "InsideBox") { boxNoteSlide = GameObject.FindGameObjectWithTag("BoxNoteSlide").GetComponent <SliderScript>(); boxAnim = GameObject.FindGameObjectWithTag("BoxAnim").GetComponent <Animator>(); CheckBoxAnim(); } else if (Application.loadedLevelName == "InsideVent") { ventNoteSlide = GameObject.FindGameObjectWithTag("VentNoteSlide").GetComponent <SliderScript>(); creepVent = GameObject.FindGameObjectWithTag("CreepVent"); creepVent.SetActive(false); } }
void OnTriggerEnter(Collider c) { if (c.GetComponent <Holdable>() != null) { holdable = c.GetComponent <Holdable>(); holdable.SetHighlightColor(); } else if (c.GetComponent <Button>() != null) { button = c.GetComponent <Button>(); } else if (c.transform.parent.parent.GetComponent <SliderScript>() != null) { slider = c.transform.parent.parent.GetComponent <SliderScript>(); } }
void Update() { RaycastHit hit; if (Physics.Raycast(transform.position, transform.forward, out hit)) { if (hit.collider.tag == "Button") { timer += Time.deltaTime; if (selected != hit.transform) { selected = hit.transform; selectedScale = selected.localScale; } else { float zoom = Mathf.PingPong(timer, zoomRange * zoomSpeed) / zoomSpeed; selected.localScale = new Vector3(selectedScale.x * (1f + zoom), selectedScale.y * (1f + zoom), selectedScale.z * (1f + zoom)); } } else if (hit.collider.tag == "Slider") { selected = hit.transform; selectedScale = selected.localScale; selectedSlider = selected.GetComponent <SliderScript>(); } else if (selected) { unselectButton(); } } if (Input.GetMouseButtonDown(0) && selected && selected.tag == "Button") { UnityEngine.UI.Button button; if ((button = selected.GetComponent <UnityEngine.UI.Button>())) { button.onClick.Invoke(); } } if (Input.GetMouseButton(0) && selected && selected.tag == "Slider") { selectedSlider.updateSlider(); } }
private void GainExp(SliderScript bar, int expValue, ref int nextLevelExpReq, ref int currentBarLevel, ref TextMeshProUGUI textMeshProUGUI) { if (currentBarLevel >= MaxLevel) return; PlaySpecialSfx(PickupItemAudioClip); var barCurrentValue = bar.GetCurrentValue() + expValue; if (barCurrentValue >= bar.GetCurrentMaxValue()) { barCurrentValue -= nextLevelExpReq; bar.SetValue(barCurrentValue); nextLevelExpReq += NextLevelExpReqOffset; bar.SetMaxValue(nextLevelExpReq); ++currentBarLevel; switch (bar.tag) { case PlayerExpUiTag: playerLevel.text = currentBarLevel.ToString(); _currentMaxHealth += MaxHealth; healthBar.SetMaxValue(_currentMaxHealth); SetBarTextValue(ref playerHpUiValue, _currentHealth.ToString(), _currentMaxHealth.ToString()); break; case WepExpUiTag: _weaponDamage += WeaponBaseDamage; break; } if (currentBarLevel >= MaxLevel) { bar.SetValue(bar.GetCurrentMaxValue()); SetBarTextValue(ref textMeshProUGUI, MaxExpText, MaxExpText); return; } } else bar.SetValue(barCurrentValue); SetBarTextValue(ref textMeshProUGUI, barCurrentValue.ToString(), bar.GetCurrentMaxValue().ToString()); }
// 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; }
void OnTriggerExit(Collider c) { var holdableExit = c.GetComponent <Holdable>(); if (holdableExit != null) { holdableExit.ResetColor(); } if (c.transform == holdable.transform) { holdable = null; } if (c.transform == button.transform) { button = null; } if (c.transform == slider.transform) { slider = null; } }
void Start() { sliderScript = GetComponent <SliderScript>(); }
void Awake() { controller = gameObject.GetComponent <CharacterController>(); CS = GameObject.FindObjectOfType <SliderScript>(); }
private void Start() { sliderScript = GameObject.Find("Slider").GetComponent <SliderScript>(); }
void Start() { ss = slider.GetComponent <SliderScript>(); }
private void Awake() { SC = GameObject.FindObjectOfType <SliderScript>(); }
// Use this for initialization void Start() { sliderScript = GetComponent <SliderScript> (); slidingOut = false; }
// Use this for initialization void Awake() { Instance = this; slideOut = false; showHUD = false; }