Ejemplo n.º 1
0
 public static void CleanResources()
 {
     Instance.StartCoroutine(CocoWait.WaitForFrame(1, () => {
         Resources.UnloadUnusedAssets();
         System.GC.Collect();
     }));
 }
Ejemplo n.º 2
0
        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;
            }));
        }
Ejemplo n.º 3
0
        protected override void Start()
        {
            base.Start();
            RegisterListener(ListenStartPoint.OnStart);

            StartCoroutine(CocoWait.WaitForFrame(1, () => RegisterListener(ListenStartPoint.AfterStart)));
        }
 public void TransitionOut(System.Action endAction = null)
 {
     StartCoroutine(CocoWait.WaitForYield(TransitionOutAsync(), endAction));
 }