protected void ProcessUISprite(string resourcePath) { var loader = KUIAtlasDep.LoadUIAtlas(resourcePath, (atlas) => { if (!IsDestroy) { //UIAtlas atlas = _obj as UIAtlas; Debuger.Assert(atlas); Debuger.Assert(DependencyComponent); var sprite = DependencyComponent as UISprite; Debuger.Assert(sprite); sprite.atlas = atlas; //对UISpriteAnimation处理 foreach (UISpriteAnimation spriteAnim in this.gameObject.GetComponents <UISpriteAnimation>()) { spriteAnim.RebuildSpriteList(); } } OnFinishLoadDependencies(gameObject); // 返回GameObject而已哦 }); ResourceLoaders.Add(loader); }
protected void ProcessUIFont(string resPath) { var loader = KUIAtlasDep.LoadUIAtlas(resPath, atlas => { if (!IsDestroy) { Debuger.Assert(atlas); UIFont uiFont = DependencyComponent as UIFont; Debuger.Assert(uiFont); //foreach (UIFont uiFont in this.gameObject.GetComponents<UIFont>()) { uiFont.atlas = atlas; uiFont.material = atlas.spriteMaterial; } } OnFinishLoadDependencies(gameObject); // 返回GameObject而已哦 }); ResourceLoaders.Add(loader); }