Пример #1
0
    public KBatchedAnimInstanceData(KAnimConverter.IAnimConverter target)
    {
        this.target = target;
        converter   = new AnimInstanceDataToByteConverter
        {
            bytes = new byte[112]
        };
        AnimInstanceData animInstanceData = converter.animInstanceData[0];

        animInstanceData.tintColour      = Color.white;
        animInstanceData.highlightColour = Color.black;
        animInstanceData.overlayColour   = Color.white;
        converter.animInstanceData[0]    = animInstanceData;
    }
Пример #2
0
    public void WriteToTexture(byte[] output_bytes, int output_index, int this_index)
    {
        AnimInstanceData animInstanceData = converter.animInstanceData[0];

        animInstanceData.curAnimFrameIndex        = (float)target.GetCurrentFrameIndex();
        animInstanceData.thisIndex                = (float)this_index;
        animInstanceData.currentAnimNumFrames     = (float)(target.IsVisible() ? target.GetCurrentNumFrames() : 0);
        animInstanceData.currentAnimFirstFrameIdx = (float)target.GetFirstFrameIndex();
        if (!isTransformOverriden)
        {
            animInstanceData.transformMatrix = target.GetTransformMatrix();
        }
        converter.animInstanceData[0] = animInstanceData;
        Buffer.BlockCopy(converter.bytes, 0, output_bytes, output_index, 112);
    }