CTextureResourceMgr

You need to add this script by AddComponent in “Awake” method of CMainSystem.

This is intended to manage the texture resources .

It is a container of CTextureResource.

The CTextureResource is downloaded or loaded from resources. This manager returns the cache if it was already loaded.

This window system also load a texture via this manager .

The resource creation method please refer to here .

Note

To read via asset bundle , you need to register the CAssetBundleMgr .

class CTextureResourceMgr
CTextureResource reference (UInt32 id)
Param uint id

Asset Bundle ID

Refers to a texture resource. If not cached, download it.

Returns CTextureResource if the texture resource exists even if it has not already been downloaded.

The returned CTextureResource is being downloaded can be determined by CTextureResource.isLoaded.

if it returns true,the asset is already loaded.

If it cannot be downloaded as an asset bundle, try to import it as resource data.

If none exists, null is returned.

static CTextureResourceMgr Instance { get; }

It has an instance of a manager

class CTextureResource

This can be cast to the Material.

Material get ()

You get the Material .

UInt32 id { get; }

It has the ID.

Boolean isLoaded { get; }

if it is already loaded,this value sets to true.

Boolean isRemain { get; }

You can see whether it is resident .

CSpriteDataOne[] spriteData { get; }

You get the sprite data .

Parts of UV information, patch information , and color information are stored.

class CSpriteDataOne

Parts of UV information, patch information , and color information are stored.

UInt32 m_id { get; }
WinColor m_color { get; }
e_Patch m_ePatch { get; }
public enum e_Patch {
    None,   //patch none
    H3,     //3 patch in a horizontal direction
    V3,     //3 patch in the vertical direction
    HV9,    //9 patch
};
Vector4 m_uv { get; set; }

UV texture information are stored .

Vector4[] m_aUV { get; set; }

If e_Patch is H3 or V3, it is stored three UV information. If e_Patch is HV9, it is stored nine UV information .