public void Edit(object parent, EventStepData data)
 {
     this.parent = parent;
     this.data = data;
     this.defaultHelper = Resources.LoadAssetAtPath("Assets/RwtM/Prefabs/Editor/EventHelper.prefab", typeof(GameObject)) as GameObject;
     this.context = EventStepDataContext.GetContext(data.type);
 }
 public void Edit(object parent, EventStepData data)
 {
     this.parent        = parent;
     this.data          = data;
     this.defaultHelper = Resources.LoadAssetAtPath("Assets/RwtM/Prefabs/Editor/EventHelper.prefab", typeof(GameObject)) as GameObject;
     this.context       = EventStepDataContext.GetContext(data.type);
 }
Пример #3
0
 void GetNext()
 {
     next = null;
     if (!(eventData.Count == 0))
     {
       next = eventData.Dequeue();
     }
 }
Пример #4
0
 void GetNext()
 {
     next = null;
     if (!(eventData.Count == 0))
     {
         next = eventData.Dequeue();
     }
 }
Пример #5
0
    public void Begin(Event root, EventStepData data)
    {
        this.root = root;
        this.data = data;

        idManager = IDManager.Get();

        StartCoroutine("Run");
    }
Пример #6
0
    public void Begin(Event root, EventStepData data)
    {
        this.root = root;
        this.data = data;

        idManager = IDManager.Get();

        StartCoroutine("Run");
    }
    private void ManageData(EventStepData data)
    {
        if (!cachedData.Contains(data))
        {
            this.cachedData.Add(data);
        }

        EvaluateTime();
    }
    public static void Draw(Rect drawAt, EventStepData data)
    {
        GetTexture();

        GUIStyle style = new GUIStyle();

        style.normal.background = texture;
        style.alignment         = TextAnchor.MiddleCenter;
        style.normal.textColor  = Color.white;

        GUILayout.BeginArea(drawAt);
        if (GUILayout.Button(data.type.ToString(), style, GUILayout.Width(drawAt.width), GUILayout.Height(drawAt.height)))
        {
        }
        GUILayout.EndArea();
    }
    public static void Draw(Rect drawAt, EventStepData data)
    {
        GetTexture();

        GUIStyle style = new GUIStyle();
        style.normal.background = texture;
        style.alignment = TextAnchor.MiddleCenter;
        style.normal.textColor = Color.white;

        GUILayout.BeginArea(drawAt);
        if (GUILayout.Button(data.type.ToString(), style, GUILayout.Width(drawAt.width), GUILayout.Height(drawAt.height)))
        {

        }
        GUILayout.EndArea();
    }
Пример #10
0
    public void Draw(EventStepData data, int index)
    {
        //GetRescale();
        ManageData(data);
        Vector2 barPos = new Vector2(TimelineHelper.ConvertTimeToOverflowPixels(data.startTime, (int)overflow.x, time),
                                     TimelineHelper.ConvertTimeToOverflowPixels(data.startTime + data.duration, (int)overflow.x, time));

        // Guarantee a minimum size for all zero-duration steps
        if (data.duration == 0f)
        {
            Vector2 minSize = barStyle.CalcSize(new GUIContent(data.type.ToString()));
            barPos.y = barPos.x + minSize.x + 4;
        }

        GUI.depth = 1;
        GUILayout.BeginArea(drawArea);
        //GUI.BeginScrollView(new Rect(0,0,drawArea.width,drawArea.height), scroll, new Rect(0,0,overflow.x,overflow.y));

        GUIStyle useForBar = this.barStyle;
        Rect     barRect   = new Rect(barPos.x, index * barHeight + index, barPos.y - barPos.x, barHeight);

        if (barRect.x + barRect.width > this.drawArea.width)
        {
            barRect.x -= barRect.width;
            useForBar  = this.occludedBarStyle;
        }

        GUI.Label(barRect, data.type.ToString(), useForBar);
        if (GUI.Button(barRect, "", labelStyle))
        {
            EventStepDataWindow stepDataWindow;
            stepDataWindow = EditorWindow.GetWindow <EventStepDataWindow>();
            stepDataWindow.Edit(this, data);
        }

        GUIContent calc = new GUIContent(data.startTime.ToString());
        Vector2    size = GUI.skin.label.CalcSize(calc);

        GUI.Label(new Rect(barRect.x, barRect.y, size.x, size.y), calc, labelStyle);
        calc.text = (data.startTime + data.duration).ToString();
        size      = GUI.skin.label.CalcSize(calc);
        GUI.Label(new Rect((barRect.x + barRect.width) - size.x, (barRect.y + barRect.height) - size.y, size.x, size.y), calc, labelStyle);

        //GUI.EndScrollView();
        GUILayout.EndArea();
    }
Пример #11
0
    new void Start()
    {
        base.Start();

        if (tempData.Count == 0)
        {
            Debug.LogWarning("Event is empty: " + gameObject.name);
            return;
        }
        foreach (EventStepData data in tempData)
        {
            eventData.Enqueue(data);
        }
        tempData.Clear();

        next   = eventData.Dequeue();
        keeper = new TimeKeeper(TimeKeeper.KeeperMode.FixedUpdate);
    }
Пример #12
0
    public void Draw(EventStepData data, int index)
    {
        //GetRescale();
        ManageData(data);
        Vector2 barPos = new Vector2(TimelineHelper.ConvertTimeToOverflowPixels(data.startTime, (int)overflow.x, time),
                                 TimelineHelper.ConvertTimeToOverflowPixels(data.startTime + data.duration, (int)overflow.x, time));

        // Guarantee a minimum size for all zero-duration steps
        if(data.duration == 0f)
        {
          Vector2 minSize = barStyle.CalcSize(new GUIContent(data.type.ToString()));
          barPos.y = barPos.x + minSize.x + 4;
        }

        GUI.depth = 1;
        GUILayout.BeginArea(drawArea);
        //GUI.BeginScrollView(new Rect(0,0,drawArea.width,drawArea.height), scroll, new Rect(0,0,overflow.x,overflow.y));

        GUIStyle useForBar = this.barStyle;
        Rect barRect = new Rect(barPos.x, index * barHeight + index, barPos.y - barPos.x, barHeight);
        if (barRect.x + barRect.width > this.drawArea.width)
        {
          barRect.x -= barRect.width;
          useForBar = this.occludedBarStyle;
        }

        GUI.Label(barRect, data.type.ToString(), useForBar);
        if (GUI.Button(barRect, "", labelStyle))
        {
          EventStepDataWindow stepDataWindow;
          stepDataWindow = EditorWindow.GetWindow<EventStepDataWindow>();
          stepDataWindow.Edit(this, data);
        }

        GUIContent calc = new GUIContent(data.startTime.ToString());
        Vector2 size = GUI.skin.label.CalcSize(calc);
        GUI.Label(new Rect(barRect.x, barRect.y, size.x, size.y), calc, labelStyle);
        calc.text = (data.startTime + data.duration).ToString();
        size = GUI.skin.label.CalcSize(calc);
        GUI.Label(new Rect((barRect.x + barRect.width) - size.x, (barRect.y + barRect.height) - size.y, size.x, size.y), calc, labelStyle);

        //GUI.EndScrollView();
        GUILayout.EndArea();
    }
Пример #13
0
 public void OpenModal(EventStepData data)
 {
     stepDataWindow = EditorWindow.GetWindow <EventStepDataWindow>();
     stepDataWindow.Edit(this, data);
 }
 void OnDestroy()
 {
     data = null;
     DestroyImmediate(helper);
 }
Пример #15
0
    private void ManageData(EventStepData data)
    {
        if (!cachedData.Contains(data))
        {
          this.cachedData.Add(data);
        }

        EvaluateTime();
    }
Пример #16
0
    new void Start()
    {
        base.Start();

        if (tempData.Count == 0)
        {
          Debug.LogWarning("Event is empty: " + gameObject.name);
          return;
        }
        foreach (EventStepData data in tempData)
        {
          eventData.Enqueue(data);
        }
        tempData.Clear();

        next = eventData.Dequeue();
        keeper = new TimeKeeper(TimeKeeper.KeeperMode.FixedUpdate);
    }
 void OnDestroy()
 {
     data = null;
     DestroyImmediate(helper);
 }
Пример #18
0
 public void OpenModal(EventStepData data)
 {
     stepDataWindow = EditorWindow.GetWindow<EventStepDataWindow>();
     stepDataWindow.Edit(this, data);
 }