public void Init(CocoRoleHolder roleHolder)
        {
            RoleHolder = roleHolder;

            // dress
            Dress = AddUnit <CocoRoleDress> ();

            StartCoroutine(CocoWait.WaitForFunc(() => {
                return(!Dress.IsReady);
            }, () => {
                // body
                Body = AddUnit <CocoRoleBody> ();

                // shadow
                if (RoleHolder.enableShadow)
                {
                    Shadow = CocoLoad.Instantiate <CocoRoleShadow> ("role/role_shadow", transform, CocoLoad.TransStayOption.Local);
                    Shadow.FollowTarget = Body.GetBone(CocoRoleBoneID.Root);
                }

                // layer
                if (transform.parent != null)
                {
                    transform.SetSelfAndChildLayer(transform.parent.gameObject.layer);
                }

                IsReady = true;
            }));
        }
        static public CocoSkinnedMeshEffect Create(SkinnedMeshRenderer _SkinnedRenderer)
        {
            CocoSkinnedMeshEffect effect = CocoLoad.Instantiate <CocoSkinnedMeshEffect> ("Coco_SkinnedMesh_Effect", _SkinnedRenderer.transform);

            effect.SetSkinnedMeshRenderer(_SkinnedRenderer);
            return(effect);
        }
        private GameObject LoadModel(CocoAssetModelHolder modelHolder)
        {
            var go = CocoLoad.Instantiate(modelHolder.AssetEntity, transform);

            LoadModelMaterials(go, modelHolder);
            return(go);
        }
Esempio n. 4
0
        public bool AddDressObject(string id, string assetPath)
        {
            if (m_DressObjectDic.ContainsKey(id))
            {
                return(false);
            }

            GameObject go = CocoLoad.Instantiate(assetPath, transform);

            RebindModelBone(go);
            m_DressObjectDic.Add(id, go);
            return(true);
        }