void Start() { tagalong = GetComponent <Tagalong>(); // Set up gestureRecognizer to listen for tapped events and what to do when event is recognized. gestureRecognizer = new GestureRecognizer(); gestureRecognizer.SetRecognizableGestures(GestureSettings.Tap | GestureSettings.Hold); gestureRecognizer.TappedEvent += gestureRecognizer_TappedEvent; gestureRecognizer.HoldStartedEvent += gestureRecognizer_HoldStartedEvent; gestureRecognizer.HoldCompletedEvent += gestureRecognizer_HoldCompletedEvent; gestureRecognizer.HoldCanceledEvent += gestureRecognizer_HoldCanceledEvent; //gestureRecognizer.StartCapturingGestures(); var devices = WebCamTexture.devices; var camName = ""; if (devices.Length > 0) { camName = devices[0].name; } for (int i = 0; i < devices.Length; i++) { if (!devices[i].isFrontFacing) { camName = devices[i].name; } } webcamTexture = new WebCamTexture(camName); }
private void UpdateInstructions() { switch (currentState) { case IntroductionState.IntroductionStateAppDescription: InstructionSlate.gameObject.SetActive(true); // position the slate in front of the user Tagalong tagalong = InstructionSlate.gameObject.GetComponent <Tagalong>(); float distance = 2.0f; if (tagalong != null) { distance = tagalong.TagalongDistance; } InstructionSlate.gameObject.transform.position = Camera.main.transform.position + (Camera.main.transform.forward * distance); InstructionSlate.DisplayMessage(InstructionSlate.InstructionText.AppDescription); break; case IntroductionState.IntroductionStateDevelopers: InstructionSlate.DisplayMessage(InstructionSlate.InstructionText.Developers); break; case IntroductionState.IntroductionStateCommunity: InstructionSlate.DisplayMessage(InstructionSlate.InstructionText.Community); break; case IntroductionState.IntroductionStateSlateFadeout: InstructionSlate.Hide(); break; } }
private void AdvanceIntroduction() { if (coreSystemsLoaded) { // change settings switch (currentState) { case IntroductionState.IntroductionStateSlateFadeout: InstructionSlate.gameObject.SetActive(false); Logo.gameObject.SetActive(true); Tagalong tagalong = Logo.gameObject.GetComponent <Tagalong>(); float distance = 2.0f; if (tagalong != null) { distance = tagalong.TagalongDistance; } // position the logo and orient it towards the user Logo.gameObject.transform.position = Camera.main.transform.position + (Camera.main.transform.forward * distance); Vector3 forwardDirection = Logo.gameObject.transform.position - Camera.main.transform.position; Logo.gameObject.transform.rotation = Quaternion.LookRotation(forwardDirection.normalized); logoAnimator.SetTrigger("FadeIn"); PlayOneShot(LogoHydrate); break; case IntroductionState.IntroductionStateLogo: logoAnimator.SetTrigger("FadeOut"); break; case IntroductionState.IntroductionStateLogoFadeout: Logo.gameObject.SetActive(false); ViewLoader.Instance.transform.position = Camera.main.transform.position + (Camera.main.transform.forward * 2.0f); ViewLoader.Instance.transform.rotation = Quaternion.LookRotation(Camera.main.transform.position - ViewLoader.Instance.transform.position); StartCoroutine(ViewLoader.Instance.LoadStartingView()); TransitionManager.Instance.ContentLoaded += ContentLoaded; placementControl.ContentPlaced += ContentPlaced; break; case IntroductionState.IntroductionStatePreloadSolarSystem: VOManager.Instance.PlayClip(CenterEarth); break; } currentState = (IntroductionState)(currentState + 1); if (currentState == IntroductionState.IntroductionStateComplete) { TransitionManager.Instance.ShowToolsAndCursor(); Destroy(gameObject); return; } UpdateInstructions(); timeInState = 0.0f; } }
private void Awake() { confirmButton = GetComponentInChildren <ConfirmButton>(); cancelButton = GetComponentInChildren <CancelButton>(); textField = GetComponentInChildren <TextMeshProUGUI>(); tagalong = GetComponent <Tagalong>(); capturer = GetComponentInChildren <PhotoCaptureWithHolograms>(); }
// Use this for initialization void Start() { //LoginBase = GameObject.Find("LoginBase"); //ContactsBase = GameObject.Find("ContactsBase"); pinButtons = GetComponentsInChildren <Button>(true).Where((b) => { return(b.name == "PinButton"); }).ToList(); tl = GetComponentInChildren <Tagalong>(); }
private void Start() { _tagalong = transform.Find("Panel").GetComponent <Tagalong>(); slider_Red = transform.Find("Panel/Red").GetComponent <Slider>(); slider_Blue = transform.Find("Panel/Blue").GetComponent <Slider>(); slider_Green = transform.Find("Panel/Green").GetComponent <Slider>(); toggle_Tagalong = transform.Find("Panel/Tagalong").GetComponent <Toggle>(); toggle_Manipultation = transform.Find("Panel/Manipulation").GetComponent <Toggle>(); }
private void Start() { tagalong = MainUICtr.Instance.Canvas.GetComponent <Tagalong>(); ParentImage = GetComponent <Image>(); GetComponent <Toggle>().onValueChanged.AddListener((isOn) => { tagalong.enabled = !isOn; ParentImage.enabled = !isOn; }); }
private void Start() { if (Slate) { tagalong = Slate.gameObject.GetComponent <Tagalong>(); if (tagalong) { distance = tagalong.TagalongDistance; } } }
// Use this for initialization void Awake() { if (CheckMarkObject == null && WaitingObject == null) { return; } InstantiateCheckMark(); InstantiateWaitingObject(); textTagAlong = GameObject.FindWithTag("AdviceBackground").GetComponent <Tagalong>(); }
// Use this for initialization void Start() { Instance = this; GameObject go = GameObject.FindWithTag("AdviceText"); adviceText = go.GetComponent <TextMesh>(); adviceText.text = ""; adviceText.color = Color.white; DefaultRotation = go.GetComponent <Billboard>().DefaultRotation; go = GameObject.FindWithTag("AdviceBackground"); background = go.gameObject; textRenderer = adviceText.GetComponent <MeshRenderer>(); backgroundRenderer = background.transform.GetComponent <MeshRenderer>(); backgroundRenderer.material.color = Color.grey - new Color(0, 0, 0, 0.25f); defaultTextScale = adviceText.transform.localScale; defaultBackgroundScale = background.transform.localScale; textRenderer.enabled = false; backgroundRenderer.enabled = false; var interpolatorHolder = GameObject.FindWithTag("AdviceBackground"); backgroundInterpolator = interpolatorHolder.EnsureComponent <Interpolator>(); interpolatorHolder = GameObject.FindWithTag("AdviceText"); textInterpolator = interpolatorHolder.EnsureComponent <Interpolator>(); backgroundTagalong = background.GetComponent <Tagalong>(); go = GameObject.FindWithTag("StageText"); stageText = go.GetComponent <TextMesh>(); stageText.text = ""; stageText.color = Color.white; go = GameObject.FindWithTag("ParametersText"); parametersText = go.GetComponent <TextMesh>(); parametersText.text = ""; parametersText.color = new Color(140, 50, 255, 100); parametersRenderer = parametersText.GetComponent <MeshRenderer>(); parametersRenderer.enabled = false; go = GameObject.FindWithTag("MenuTipText"); menuTipText = go.GetComponent <TextMesh>(); menuTipText.text = "Say 'Open Menu' or tap and hold for some seconds to open the menu."; menuTipText.color = Color.white; flag = true; Invoke("DestroyMenuTipText", 8); }
void Start() { toolbar = GetComponentInChildren <Toolbar>(); toolbarTagalong = toolbar.gameObject.GetComponent <Tagalong>(); minimiseButton = toolbar.transform.Find("MinimiseButton").gameObject; maximiseButton = toolbar.transform.Find("MaximiseButton").gameObject; originalLocalScale = transform.localScale; panelOne = transform.Find("PanelOne").gameObject; panelTwo = transform.Find("PanelTwo").gameObject; panelThree = transform.Find("PanelThree").gameObject; walletOpenToolbarPosition = toolbar.transform.localPosition; StartCoroutine(MinimiseWallet()); }
void Start() { toolbar = FindObjectOfType <Toolbar>(); tagalong = toolbar.EnsureComponent <Tagalong>(); buttonText = gameObject.GetComponent <CompoundButtonText>(); }