Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How to detect MouseDown In the ClipEditor?

Discussion in 'Timeline' started by sans108, Feb 9, 2022.

  1. sans108

    sans108

    Joined:
    Apr 1, 2021
    Posts:
    13
    Hi,

    I create a customized Clip. And override the ClipEditor.DrawBackground to show keyframes on it.

    upload_2022-2-9_11-15-12.png

    Now I want to drag these keyframes on clip, how can I detect MouseDown?

    I Tried to Write "Event.current.Type == EventType.MouseDown" in the Method "ClipEditor.DrawBackground". But it doesn't work. This method seems only support "EventType.Repaint".

    If anyone knows the answer, please share it with me.

    Thanks!
     
  2. sans108

    sans108

    Joined:
    Apr 1, 2021
    Posts:
    13
    I found there is no way to extend keyframe without change timeline code.
    So finally I changed the timeline code, created a new layer to detect keyframe on the clip.

    upload_2022-2-23_14-59-35.gif
     
    kirarudo likes this.