Skip to content

Commit

Permalink
Update Document.md
Browse files Browse the repository at this point in the history
  • Loading branch information
liangxiegame authored Jun 22, 2018
1 parent b561190 commit d97c1c8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Assets/QFramework/Framework/2.ResKit/Document.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ loader = null;
``` csharp
// init res mgr before load asset bundle
ResMgr.Init();

// allocate a loader when initialize a panel or a monobehavour
var loader = ResLoader.Allocate<ResLoader>();

// load someth in a panel or a monobehaviour
loader.LoadSync<GameObject>("smobj")
var smObjPrefab = loader.LoadSync<GameObject>("smObj");

var bgTexture = loader.LoadSync<Texture2D>("Bg");

loader.LoadSync<Texture2D>("Bg")
var logoTexture = loader.LoadSync<Texture2D>("hometextures","logo");

// resycle this panel/monobehaivour loaded res when destroyed
loader.Recycle2Cache()
loader = null
loader.Recycle2Cache();

loader = null;
```

0 comments on commit d97c1c8

Please sign in to comment.