private void displayCards() { int i = 0; HandPrefab currHand = hands[i].GetComponent <HandPrefab>(); foreach (var c in deck.getCards()) { GameObject newCard = Instantiate(this.card); newCard.GetComponent <CardPrefab>().setCard(c); if (currHand.isHandFull()) { i++; currHand = hands[i].GetComponent <HandPrefab>(); } currHand.addCard(newCard); } }
void RightTeleportUpdate() { Vector2 axisInput; m_RightInputDevice.TryGetFeatureValue(CommonUsages.primary2DAxis, out axisInput); m_RightLineVisual.enabled = axisInput.y > 0.5f; RightTeleportInteractor.InteractionLayerMask = m_LastFrameRightEnable ? m_OriginalRightMask : new LayerMask(); if (axisInput.y <= 0.5f && m_PreviousRightClicked) { m_RightController.Select(); } if (axisInput.y <= -0.5f) { if (!RightTractorBeam.IsTracting) { RightTractorBeam.StartTracting(); } } else if (RightTractorBeam.IsTracting) { RightTractorBeam.StopTracting(); } //if the right animator is null, we try to get it. It's not the best performance wise but no other way as setup //of the model by the Interaction Toolkit is done on the first update. if (m_RightHandPrefab == null) { m_RightHandPrefab = RightDirectInteractor.GetComponentInChildren <HandPrefab>(); } m_PreviousRightClicked = axisInput.y > 0.5f; if (m_RightHandPrefab != null) { m_RightHandPrefab.Animator.SetBool("Pointing", m_PreviousRightClicked); } m_LastFrameRightEnable = m_RightLineVisual.enabled; }