Esempio n. 1
0
            public TimelineState GetTimelineState(GameObject sourceObject = null)
            {
                if (_timelineState == null)
                {
                    if (string.IsNullOrEmpty(_file._filePath))
                    {
                        if (_stateMachine != null)
                        {
                            foreach (TimelineState state in _stateMachine._states)
                            {
                                if (state._stateId == _stateId)
                                {
                                    _timelineState = state;
                                    break;
                                }
                            }
                        }
                        else
                        {
                            throw new Exception("TimelineStateRefProperty need to be fixed up by TimelineStateMachine");
                        }
                    }
                    else
                    {
                        TextAsset asset = _file.LoadAsset();
                        _stateMachine = TimelineStateMachine.FromTextAsset(asset, sourceObject);
                        _file.UnloadAsset();
                        _timelineState = _stateMachine.GetTimelineState(_stateId);
                    }
                }

                return(_timelineState);
            }
            public TimelineState LoadTimelineState(GameObject sourceObject = null)
            {
                if (_file != null)
                {
                    TimelineStateMachine stateMachine = TimelineStateMachine.FromTextAsset(_file, sourceObject);
                    return(stateMachine.GetTimelineState(_timelineId));
                }

                return(null);
            }