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); }
void GetNext() { next = null; if (!(eventData.Count == 0)) { next = eventData.Dequeue(); } }
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 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(); }
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); }
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(); }
public void OpenModal(EventStepData data) { stepDataWindow = EditorWindow.GetWindow <EventStepDataWindow>(); stepDataWindow.Edit(this, data); }
void OnDestroy() { data = null; DestroyImmediate(helper); }
public void OpenModal(EventStepData data) { stepDataWindow = EditorWindow.GetWindow<EventStepDataWindow>(); stepDataWindow.Edit(this, data); }