Exemple #1
0
        public static void AddSkeletonBoneLines(Animator animator, Color color, int render_queue_plus, float parent_width, float child_width)
        {
            Material line_material = GetBoneLineMaterial(color, render_queue_plus);

            if (line_material)
            {
                int counter = NSH.AddBonesComponents <BoneLine>(animator, delegate_add_bone_line, line_material, parent_width, child_width);
                Debug.Log(string.Format("[NeuronUtilities] {0} Bone lines added to {1}.", counter, animator.gameObject.name), animator.gameObject);
            }
        }
Exemple #2
0
        public static void AddSkeletonBoneLines(Animator animator, Color color, int render_queue_plus, float parent_width, float child_width)
        {
            Material line_material = GetBoneLineMaterial(color, render_queue_plus);

            if (line_material)
            {
                int counter = NSH.AddBonesComponents <BoneLine>(animator, delegate_add_bone_line, line_material, parent_width, child_width);

                // add bone line for spine1 and spine2 which we do not assign to animator
                Transform t     = animator.GetBoneTransform(HumanBodyBones.Chest);
                Transform child = t;
                t = t.parent;
                while (t != null && t.GetComponent <BoneLine>() == null)
                {
                    BoneLine bone_line = t.gameObject.AddComponent <BoneLine>();
                    child = t;
                    t     = t.parent;
                    bone_line.AddRenderer(line_material, parent_width, child_width, t, child);

                    counter++;
                }

                // add bone line for head_end
                t = animator.GetBoneTransform(HumanBodyBones.Head);
                if (t != null && t.childCount > 0)
                {
                    // get end_end
                    child = t.GetChild(0);
                    if (child != null)
                    {
                        BoneLine boneline = child.gameObject.AddComponent <BoneLine>();
                        boneline.AddRenderer(line_material, parent_width, child_width, t, child);
                        counter++;
                    }
                }

                Debug.Log(string.Format("[NeuronUtilities] {0} Bone lines added to {1}.", counter, animator.gameObject.name), animator.gameObject);
            }
        }
Exemple #3
0
        public static void AddSkeletonRigidBodies(Animator animator)
        {
            int counter = NSH.AddBonesComponents <Rigidbody>(animator, delegate_add_rigidbody);

            Debug.Log(string.Format("[NeuronUtilities] {0} Rigidbodies added to {1}.", counter, animator.gameObject.name), animator.gameObject);
        }