void MakePlayer(OnlineBody body) { currentPlayer = body; // parent to neck //head.localPosition = new Vector3 (0, 0, 0); }
void MakePlayer(int index) { currentPlayer = OnlineBodyView.s.bodies[index]; currentPlayerIndex = index; // parent to neck //head.localPosition = new Vector3 (0, 0, 0); }
public void CreateBody(string name) { for (int i = 0; i < bodies.Length; i++) { if (bodies[i] == null) { bodies[i] = new OnlineBody(name); //bodies[i].character = Instantiate(avatarPrefab, new Vector3(0f, 0f, 0f), avatarPrefab.rotation) as Transform; //MapToKinect map = bodies[i].character.GetComponent<MapToKinect>(); //map.AssignBody (name); break; } } }
public BodyPart(string aName, GameObject parentBody, OnlineBody body) { parentOnlineBody = body; name = aName; go = GameObject.CreatePrimitive(PrimitiveType.Sphere); //go = new GameObject (name); //go.GetComponent<Renderer> ().enabled = false; go.name = name; go.transform.parent = parentBody.transform; go.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f); go.layer = LayerMask.NameToLayer("PlayerPoints"); Rigidbody rb = go.AddComponent <Rigidbody> (); rb.useGravity = false; rb.isKinematic = true; go.AddComponent <SphereCollider> (); r = go.GetComponent <Renderer> (); r.material = ObjectManager.s.coolMat; r.enabled = false; //lr = go.AddComponent<LineRenderer> (); //lr.SetVertexCount (2); //lr.SetWidth (0.1f, 0.1f); //lr.SetColors (Color.black, Color.black); //lr.material = ObjectManager.s.lineMat; if (aName == "HandTipLeft" || aName == "HandTipRight" || aName == "HandLeft" || aName == "HandRight" || aName == "ThumbRight" || aName == "ThumbLeft") { r.enabled = false; } else if (aName == "WristLeft" || aName == "WristRight") { r.enabled = false; /* * HandModel hand = go.AddComponent<HandModel>(); * * if (aName == "WristLeft") * parentOnlineBody.handLeft = hand; * if (aName == "WristRight") * parentOnlineBody.handRight = hand; */ } else { } }
public void CreateBody(string name) { for (int i = 0; i < bodies.Length; i++) { if (bodies[i] == null) { bodies[i] = new OnlineBody(name); //bodies[i].avatar = Instantiate (ObjectManager.s.avatarPrefab, bodies[i].go.transform.position, ObjectManager.s.avatarPrefab.rotation) as Transform; //bodies[i].avatar.parent = bodies[i].go.transform; //bodies[i].avatar.localPosition = new Vector3(0,0,0); //bodies[i].anim = bodies[i].avatar.gameObject.GetComponent<Animator>(); //bodies[i].character = Instantiate(avatarPrefab, new Vector3(0f, 0f, 0f), avatarPrefab.rotation) as Transform; //MapToKinect map = bodies[i].character.GetComponent<MapToKinect>(); //map.AssignBody (name); break; } } }