-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timeline Inspector Button #385
Comments
using NaughtyAttributes;
using Timeline.Samples;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
public class CustomDialogPlayableAsset : PlayableAsset, ITimelineClipAsset
{
[NoFoldOut]
[NotKeyable]
public CustomDialogBehaviour template = new()
{
cloudColor = Color.white,
textColor = Color.white,
dialogText = ""
};
[Button("ToUpper")] // this also not displaying any btn
void ToUpper()
{
UnityEditor.Undo.RecordObject(this, "ToUpperCase");
template.dialogText = template.dialogText.ToUpper();
UnityEditor.EditorUtility.SetDirty(this);
}
public ClipCaps clipCaps
{
get { return ClipCaps.Blending; }
}
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
{
return ScriptPlayable<CustomDialogBehaviour>.Create(graph, template);
}
}
#if UNITY_EDITOR
[UnityEditor.CustomEditor(typeof(CustomDialogPlayableAsset)), UnityEditor.CanEditMultipleObjects]
public class CustomDialogPlayableAssetEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
if (GUILayout.Button("ToUpperCase")) // this is displaying Btn
{
var customDialogBehaviour = target as CustomDialogPlayableAsset;
customDialogBehaviour.template.dialogText = customDialogBehaviour.template.dialogText.ToUpper();
serializedObject.ApplyModifiedProperties();
}
DrawDefaultInspector();
}
}
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
here is my Code for Time timeline Track
The text was updated successfully, but these errors were encountered: