Пример #1
0
        protected void ReloadKnobTexture()
        {
            ReloadType();

            if (side != defaultSide)
            {             // Rotate Knob texture according to the side it's used on
                int rotationSteps = getRotationStepsAntiCW(defaultSide, side);

                ResourceManager.MemoryTexture memoryTex = ResourceManager.FindInMemory(knobTexture);
                List <string> mods = memoryTex.modifications.ToList();
                mods.Add("Rotation:" + rotationSteps);

                Texture2D knobTextureInMemory = ResourceManager.GetTexture(texturePath, mods.ToArray());

                if (knobTextureInMemory != null)
                {
                    knobTexture = knobTextureInMemory;
                }
                else
                {
                    knobTexture = RTEditorGUI.RotateTextureAntiCW(knobTexture, rotationSteps);
                    ResourceManager.AddTexture(texturePath, knobTexture, mods.ToArray());
                }
            }
        }