private void Init() { GameObject bone = Instantiate(Resources.Load <GameObject>(boneName)); GameObject[] meshs = new GameObject[meshNames.Length]; for (int i = 0; i < meshs.Length; i++) { meshs[i] = Resources.Load <GameObject>(meshNames[i]); } SkinnedMeshCombine.CombineSkinnedMesh(bone, meshs, combineMaterial, CombineMaterial); animaton = bone.GetComponent <Animation>(); animaton.wrapMode = WrapMode.Loop; animaton.Play("breath"); Resources.UnloadUnusedAssets(); }
protected void Test() { if (isInit == true) { return; } isInit = true; SkinnedMeshCombine combine = new SkinnedMeshCombine(); combine.Combine(this.gameObject.AddComponent <SkinnedMeshRenderer>(), null, this.gameObject.GetComponentsInChildren <SkinnedMeshRenderer>(), new string[] { "_MainTex", "_BumpMap" }, new Material(Shader.Find("Mobile/Bumped Diffuse")), 1024, 512, true); }