예제 #1
0
    void Start()
    {
        JointType[] typeJoint = Enum.GetValues(typeof(JointType)).Cast <JointType>().ToArray();
        JointTrackers = new JointTracker[typeJoint.Length];

        if (DefaultToUserTracker)
        {
            SkeletonProvider = CurrentUserTracker.Instance;
        }

        Vector3 origin = new Vector3(TorsoX, TorsoY, TorsoZ);

        for (int i = 0; i < typeJoint.Length; i++)
        {
            string     jointName    = $"{typeJoint[i]} - {(String.IsNullOrEmpty(JointNameModifier) ? "Default" : JointNameModifier)}";
            GameObject createdJoint = GameObject.Find(jointName) ?? Instantiate(PrefabJoint);
            createdJoint.transform.SetParent(transform);
            createdJoint.name = jointName;

            JointTracker tracker = createdJoint.GetComponent <JointTracker>();
            tracker.OwnerNativeAvatar = this;
            tracker.Bound             = Bound;
            tracker.Origin            = origin;
            tracker.JointType         = typeJoint[i];
            tracker.OffsetJointType   = JointType.Waist;
            tracker.SkeletonProvider  = SkeletonProvider;
            tracker.Enabled           = IsEnabled;
            JointTrackers[i]          = tracker;
        }
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     m_jointTracker = GetComponent <JointTracker>();
 }
예제 #3
0
    public void SetColor(JointType jointType, Color color)
    {
        JointTracker tracker = FindTracker(jointType);

        tracker.Color = color;
    }
 void Start()
 {
     m_activeTracker = GetComponent <JointTracker>();
     m_handState     = HandState.Open;
 }