Example #1
0
 public KAnimBatchTextureCache.Entry CreateTexture(string name, int size_in_floats, int texture_property_id, int texture_size_property_id)
 {
     DebugUtil.Assert(size_in_floats > 0);
     KAnimBatchTextureCache.Entry entry = cache.Get(size_in_floats, texture_property_id, texture_size_property_id);
     entry.name = name;
     return(entry);
 }
Example #2
0
 public void FreeResources()
 {
     if (buildAndAnimTex != null)
     {
         cache.Free(buildAndAnimTex);
         buildAndAnimTex = null;
     }
     for (int i = 0; i < 5; i++)
     {
         if ((Object)materials[i] != (Object)null)
         {
             Object.Destroy(materials[i]);
             materials[i] = null;
         }
     }
     if ((Object)mesh != (Object)null)
     {
         Object.Destroy(mesh);
         mesh = null;
     }
     if (data != null)
     {
         data.FreeResources();
     }
     data = null;
 }
Example #3
0
    public void InitBuildAndAnimTex()
    {
        float num             = GetBuildDataSize() + GetAnimDataSize();
        int   bestTextureSize = GetBestTextureSize(num);

        buildAndAnimTex      = cache.Get(bestTextureSize, ShaderProperty_buildAndAnimTex, ShaderProperty_BUILD_AND_ANIM_TEXTURE_SIZE);
        buildAndAnimTex.name = "BuildAndAnimData:" + batchID.ToString();
        if (num > (float)(buildAndAnimTex.width * buildAndAnimTex.height))
        {
            Debug.LogErrorFormat("Texture is the wrong size! {0} <= {1}", num, buildAndAnimTex.width * buildAndAnimTex.height);
        }
        int start_index = data.WriteBuildData(data.symbolFrameInstances, buildAndAnimTex.floats);

        data.WriteAnimData(start_index, buildAndAnimTex.floats);
        buildAndAnimTex.LoadRawTextureData();
        buildAndAnimTex.Apply();
    }
Example #4
0
 public void FreeTexture(KAnimBatchTextureCache.Entry entry)
 {
     cache.Free(entry);
 }