private void RenderExternalState(EditorStateLink link, TimelineStateEditorGUI fromState, float edgeFraction) { TimelineStateEditorGUI externalState = null; //Find external link for this state foreach (TimelineStateEditorGUI state in _editableObjects) { if (state.IsExternal && state.ExternalStateRef._stateId == link._timeline._stateId && state.ExternalStateRef._file._fileGUID == link._timeline._file._fileGUID) { externalState = state; break; } } //If none exists, create a new one if (externalState == null) { externalState = (TimelineStateEditorGUI)AddNewObject(new TimelineState()); externalState.IsExternal = true; externalState.ExternalStateRef = link._timeline; _editableObjects.Add(externalState); } if (!externalState.ExternalHasRendered) { externalState.CalcBounds(_style._noteTextStyle, _style._externalStateTextStyle); bool selected = _selectedObjects.Contains(externalState); Color borderColor = selected ? _style._stateBackgroundSelected : _style._stateBackground; Rect renderedRect = GetScreenRect(externalState.GetBounds()); externalState.Render(renderedRect, borderColor, _style._externalStateColor, _style._noteTextStyle, _style._externalStateTextStyle, selected ? 2.0f : 1.0f); externalState.ExternalHasRendered = true; } RenderLink(link._description, fromState, externalState, edgeFraction); }
public EditorStateLink[] GetEditorLinks() { EditorStateLink[] links = new EditorStateLink[1]; links[0] = new EditorStateLink(); links[0]._timeline = _state; links[0]._description = (_condition != null ? _condition.GetEditorDescription() : "..."); return(links); }
private TimelineStateEditorGUI FindStateForLink(EditorStateLink link) { foreach (TimelineStateEditorGUI state in _editableObjects) { if (link._timeline.GetStateID() == state.GetStateId()) { return(state); } } return(null); }
public EditorStateLink[] GetEditorLinks() { EditorStateLink[] links = new EditorStateLink[_branches.Length]; for (int i = 0; i < _branches.Length; i++) { Branch branch = _branches[i]; links[i] = new EditorStateLink(); links[i]._timeline = branch._goToState; links[i]._description = branch.GetDescription(); } return(links); }
public EditorStateLink[] GetEditorLinks() { EditorStateLink[] links = null; switch (_stateType) { case eStateType.Coroutine: break; case eStateType.Timeline: links = new EditorStateLink[1]; links[0] = new EditorStateLink(); links[0]._timeline = _state; links[0]._description = "Go To"; break; } return(links); }
public EditorStateLink[] GetEditorLinks() { EditorStateLink[] links = new EditorStateLink[1]; links[0] = new EditorStateLink(); links[0]._timeline = _state; switch (_preStateType) { case eStateType.Coroutine: links[0]._description = "Run " + _preCoroutine + " then"; break; case eStateType.Timeline: links[0]._description = "Run " + _preState + " then"; break; } return(links); }