public void Add(KAnimConverter.IAnimConverter controller)
    {
        int layer = controller.GetLayer();

        if (layer != key.layer)
        {
            Debug.LogError("Registering with wrong batch set (layer) " + controller.GetName());
        }
        HashedString batchGroupID = controller.GetBatchGroupID(false);

        if (!(batchGroupID == key.groupID))
        {
            Debug.LogError("Registering with wrong batch set (groupID) " + controller.GetName());
        }
        KAnimBatchGroup.MaterialType materialType = controller.GetMaterialType();
        for (int i = 0; i < batches.Count; i++)
        {
            if (batches[i].size < group.maxGroupSize && batches[i].materialType == materialType)
            {
                if (batches[i].Register(controller))
                {
                    SetDirty();
                }
                return;
            }
        }
        KAnimBatch kAnimBatch = new KAnimBatch(group, layer, controller.GetZ(), materialType);

        kAnimBatch.Init();
        AddBatch(kAnimBatch);
        kAnimBatch.Register(controller);
    }
 private BatchKey(KAnimConverter.IAnimConverter controller)
 {
     _layer        = controller.GetLayer();
     _groupID      = controller.GetBatchGroupID(false);
     _materialType = controller.GetMaterialType();
     _z            = controller.GetZ();
     _idx          = KAnimBatchManager.ControllerToChunkXY(controller);
     _hash         = 0;
 }