private void Start() { if (handUIManager == null) { var foundObjects = FindObjectsOfType <HandUIManager>(); if (foundObjects.Length > 0) { handUIManager = foundObjects[0]; } else { Debug.LogError("HandUIManager is missing in the scene."); } } if (objectType == ObjectType.Line) { lineRenderer = GetComponent <LineRenderer>(); } if (objectType == ObjectType.Rect) { initButtonSize = buttonSize; } handL = HandUIManager.handLeft; handR = HandUIManager.handRight; }
void Start() { mr = GetComponent <MeshRenderer>(); target = transform.position; initialScale = transform.localScale; if (HandUIManager == null) { var foundObjects = FindObjectsOfType <HandUIManager>(); if (foundObjects.Length > 0) { HandUIManager = foundObjects[0]; } else { Debug.LogError("HandUIManager is missing in the scene."); } } if (whichHand == Chirality.Left) { hand = HandUIManager.handLeft; pg = HandUIManager.pinchLeft; } else { hand = HandUIManager.handRight; pg = HandUIManager.pinchRight; } }
public void Appear(Chirality whichHand) { self.Show(0, 0.1f); currentlyHoveringHand = HandUIManager.GetHand(whichHand); currentOffset = whichHand == Chirality.Right ? pinchPointOffsetR : pinchPointOffsetL; shown = true; }
private void FindComponent() { switch (objectType) { case ObjectType.Mesh: mesh = GetComponent <MeshRenderer>(); break; case ObjectType.Line: line = GetComponent <LineRenderer>(); break; case ObjectType.Sprite: sprite = GetComponent <SpriteRenderer>(); break; case ObjectType.Image: image = GetComponent <Image>(); break; case ObjectType.Text: text = GetComponent <TextMeshPro>(); break; case ObjectType.Auto: HandUIManager.Warn("UIEntity color component not found, try setting the object type value", this); break; } }
public void SetColor(float a, float t = 0.15f) { var c = HandUIManager.GetColor(a); if (useCustomColor) { c = overrideTint; c.a = a; } if (!renderComponentFound) { DetermineType(); } switch (objectType) { case ObjectType.Mesh: if (mesh.material.HasProperty("_Color")) { mesh.material.DOColor(c, t); } else { mesh.material.SetColor("_TintColor", c); } break; case ObjectType.Line: if (line.material.HasProperty("_Color")) { line.material.DOColor(c, t); } else if (line.material.HasProperty("_TintColor")) { line.material.SetColor("_TintColor", c); } break; case ObjectType.Sprite: sprite.DOColor(c, t); break; case ObjectType.Image: image.DOColor(c, t); break; case ObjectType.Text: if (!guiText) { text.DOColor(c, t); } else { textGUI.DOColor(c, t); } break; } }
//-------------------------------------------------- //-------------------------------------------------- public void TunnelSliceScanComplete() //-------------------------------------------------- { tunnelScanCompleted = true; HandUIManager handUI = m_scientistPlayer.GetComponentInChildren <HandUIManager>(); handUI.SwitchHandUI(HandUIManager.HandUI.DATA_SELECTOR); }
private void OnEnable() { hand = HandUIManager.GetHand(whichHand); pinch = HandUIManager.GetPinchGesture(whichHand); self = GetComponent <UIEntity>(); hrt = keyboardPlane.GetComponent <HandRaycastTarget>(); pinch.OnOpen += OnPinch; self.Hide(0, 0.05f); }
public void SpawnKeyboard() { transform.localScale = Vector3.zero; transform.position = HandUIManager.PostitionInFrontOfHead(spawnOffset.z, spawnOffset.y); transform.LookAt(transform.position - (HandUIManager.head.position - transform.position)); transform.eulerAngles = Vector3.up * transform.eulerAngles.y; self.Scale(1); // Vector3 newPos = HandUIManager.PostitionInFrontOfHead() ; }
void OnEnable() { handUI = transform.GetComponent <HandUIObject>(); if (handUI == null) { HandUIManager.Warn("HandUIItem couldn't find HandUIObject!", this); } handUI.OnHoverBegin += OnHoverBegin; handUI.OnHoverEnd += OnHoverEnd; handUI.OnPinchBegin += OnPinchBegin; handUI.OnPinchEnd += OnPinchEnd; }
void Start() { initScale = transform.localScale; circle = GetComponent <CircleLine>(); hand = HandUIManager.GetHand(whichHand); uiColor = GetComponent <UIColor>(); minY = transform.localPosition.y; if (this.enabled) { Hide(); } }
private void Start() { head = HandUIManager.head; hand = HandUIManager.GetHand(whichHand); pg = HandUIManager.GetPinchGesture(whichHand); // AirTap init, getting index and wrist postions fPos = hand.leapHand.GetIndex().TipPosition.ToVector3(); fPrevPos = fPos; wPos = hand.leapHand.WristPosition.ToVector3(); wPrevPos = wPos; }
public void SetColor(float a, float t = 0.15f) { var c = HandUIManager.GetColor(a); if (useCustomColor) { c = customColor; c.a = a; } if (!componentFound) { FindComponent(); } switch (objectType) { case ObjectType.Mesh: if (mesh.material.HasProperty("_Color")) { mesh.material.DOColor(c, t).SetId(""); } else { mesh.material.SetColor("_TintColor", c); } break; case ObjectType.Line: if (line.material.HasProperty("_Color")) { line.material.DOColor(c, t); } else if (line.material.HasProperty("_TintColor")) { line.material.SetColor("_TintColor", c); } break; case ObjectType.Sprite: sprite.DOColor(c, t); break; case ObjectType.Text: text.DOColor(c, t); break; } }
// Use this for initialization void Start() { line = GetComponentInChildren <LineProjector>(); lineColor = line.transform.GetComponent <UIColor>(); pg = HandUIManager.GetPinchGesture(whichHand); hand = whichHand == Chirality.Left ? HandUIManager.handLeft : HandUIManager.handRight; projector = GetComponentInChildren <Projector>(); projectorColor = projector.transform.GetComponent <UIColor>(); initSphereParentScale = sphere.parent.localScale; CalculateBounds(); HideSphere(); }
void Start() { line = GetComponent <LineRenderer>(); if (transform.parent.GetComponent <HandRaycast>()) { hr = transform.parent.GetComponent <HandRaycast>(); hand = HandUIManager.GetHand(hr.whichHand); } else { HandUIManager.Warn("HandRaycast not found", this); } DimDown(); Hide(); }
//-------------------------------------------------- //-------------------------------------------------- private IEnumerator IE_LoadingData() //-------------------------------------------------- { //Debug.Log("Loading data..."); currentGameState = GameState.LOADING; HandUIManager handUI = m_scientistPlayer.GetComponentInChildren <HandUIManager>(); handUI.SetLoadingText("Loading data..."); handUI.SwitchHandUI(HandUIManager.HandUI.LOADING); while (!m_dataManager.DataLoaded()) { yield return(null); } //Debug.Log("Data loaded successfully!"); handUI.SwitchHandUI(HandUIManager.HandUI.MAIN_MENU); OnLoadMapIntializer(); }
public static Vector3 stablePinchPos(this InteractionHand hand) { return(HandUIManager.GetPinchGesture(hand.chirality()).stablePinch.position); }
public static bool isPinched(this InteractionHand hand) { return(HandUIManager.GetPinchGesture(hand.chirality()).isActive&& hand.isTracked); }
public static Transform stablePinchTransform(this InteractionHand hand) { return(HandUIManager.GetPinchGesture(hand.chirality()).stablePinch); }
private void Start() { hand = HandUIManager.GetHand(whichHand); Hide(); }