Esempio n. 1
0
        public static void LoadAsync(string name, CollisionFile file, Transform destParent, bool forceConvex, System.Action onFinish)
        {
            // load collision file asyncly, and when it's ready just call the other function

            if (file != null)
            {
                // collision file already loaded
                // just call other function

                Utilities.F.RunExceptionSafe(() => Load(file, destParent, forceConvex));
                onFinish();
                return;
            }

            // load collision file asyncly
            CollisionFile.FromNameAsync(name, (cf) => {
                // loading finished
                // call other function
                if (cf != null)
                {
                    Utilities.F.RunExceptionSafe(() => Load(cf, destParent, forceConvex));
                }
                onFinish();
            });
        }