Пример #1
0
        protected GameObject AddPart(E_AvatarPart part, GameObject pfb_go)
        {
            GameObject go = Object.Instantiate(pfb_go);

            TransformHelper.Reset(go, _skeleton_go);
            _avatar_part_map.Add(part, go);
            return(go);
        }
Пример #2
0
        public void CombineSkinnedMesh()
        {
            TransformHelper.DestroyComponent <SkinnedMeshRenderer>(_skeleton_go);

            SkinnedMeshRenderer skinned_mesh = _skeleton_go.AddComponent <SkinnedMeshRenderer>();

            skinned_mesh.sharedMesh = new Mesh();
            skinned_mesh.sharedMesh.CombineMeshes(_combines.ToArray(), false, false);
            skinned_mesh.bones     = _skeleton_trans.ToArray();
            skinned_mesh.materials = _mats.ToArray();

            //_combines.Clear();
            //_mats.Clear();
            //_skeleton_trans.Clear();
        }
Пример #3
0
        public void CreateSkinnedMesh()
        {
            TransformHelper.DestroyComponent <SkinnedMeshRenderer>(_skeleton_go);

            SkinnedMeshRenderer skinned = _skeleton_go.AddComponent <SkinnedMeshRenderer>();

            skinned.sharedMesh = new Mesh();
            skinned.sharedMesh.CombineMeshes(_combines.ToArray(), true, false);
            skinned.bones    = _skeleton_trans.ToArray();
            skinned.material = _new_material;

            for (int i = 0; i < _combines.Count; i++)
            {
                _combines[i].mesh.uv = _old_uv[i];
            }
        }
Пример #4
0
 public virtual void Init(GameObject pfb_skeleton)
 {
     _skeleton_go = Object.Instantiate(pfb_skeleton);;
     TransformHelper.CollectionTrans(_skeleton_go, _skeleton_map);
 }