// Render texture property.
        public bool RenderTextureGroupProperty(ProfileGroupDefinition def)
        {
            EditorGUILayout.BeginHorizontal();

            TextureKeyframeGroup group = m_Profile.GetGroup <TextureKeyframeGroup>(def.propertyKey);

            EditorGUILayout.PrefixLabel(new GUIContent(group.name, def.tooltip));
            bool valueChanged = false;

            if (m_Profile.IsManagedByTimeline(def.propertyKey))
            {
                RenderManagedOnTimlineMessage();
            }
            else
            {
                TextureKeyframe frame = group.GetKeyframe(0);
                EditorGUI.BeginChangeCheck();
                Texture assignedTexture = (Texture)EditorGUILayout.ObjectField(frame.texture, typeof(Texture), true);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(m_Profile, "Changed texture keyframe value");
                    frame.texture = assignedTexture;
                    valueChanged  = true;
                }
            }

            EditorGUILayout.EndHorizontal();
            return(valueChanged);
        }
Exemple #2
0
 public TextureKeyframe(TextureKeyframe keyframe) : base(keyframe.time)
 {
     this.texture           = keyframe.texture;
     interpolationCurve     = keyframe.interpolationCurve;
     interpolationDirection = keyframe.interpolationDirection;
 }