HandModel.SetLeapHand C# (CSharp) Метод

SetLeapHand() публичный Метод

public SetLeapHand ( Hand, hand ) : void
hand Hand,
Результат void
  public void SetLeapHand(Hand hand) {
    hand_ = hand;
    for (int i = 0; i < fingers.Length; ++i) {
      if (fingers[i] != null) {
        fingers[i].SetLeapHand(hand_);
        fingers[i].SetOffset(GetHandOffset());
      }
    }
  }

Usage Example

Пример #1
0
    private void DestroyHand(HandModel hand_model)
    {
        if (destroyHands)
        {
            // Cleans up mirror hand object on deletion of its respective hand
            if (hand_model.gameObject.name == "RigidHand(Clone)")
            {
                int        handID = hand_model.GetLeapHand().Id;
                GameObject refObj = GameObject.Find(handID.ToString());
                // Detaches children to prevent deleting an object currently moving with the hand
                GameObject cubes = GameObject.Find("Cubes");

                if (refObj != null)
                {
//					refObj.transform.DetachChildren();
//					if(refObj.transform.childCount > 0){
//						refObj.transform.GetChild(0).parent = cubes.transform;
//					}
                    for (int i = 0; i < cubes.transform.childCount; i++)
                    {
                        cubes.transform.GetChild(i).gameObject.renderer.material.color = Color.gray;
                    }
                }
            }

            Destroy(hand_model.gameObject);
        }
        else
        {
            hand_model.SetLeapHand(null);
        }
    }
All Usage Examples Of HandModel::SetLeapHand