예제 #1
0
 private void GetRagdoll()
 {
     if (ragdoll != null)
     {
         ragdoll.Die();
         ragdoll.baseRigidbody = null;
     }
     ragdoll = RagdollPool.singleton.GetRagdoll(thisRigidbody);
 }
예제 #2
0
    void Awake()
    {
        singleton = this;
        Vector3    pos = transform.position;
        Quaternion rot = transform.rotation;

        for (int i = 0; i < ragdollCount; i++)
        {
            GameObject obj = (GameObject)Instantiate(ragdollPrefab, pos, rot);
            obj.name             = "Ragdoll " + i;
            obj.transform.parent = transform;
            RagdollPlayer rg = obj.GetComponent <RagdollPlayer>();
            rg.Die();
            rg.enabled = false;
        }
    }