Exemplo n.º 1
0
        public static TimelineConfigurationGameObject Get()
        {
            if (Instance == null)
            {
                Instance = FindObjectOfType <TimelineConfigurationGameObject>();
            }

            return(Instance);
        }
Exemplo n.º 2
0
        public virtual void Init(TimelineInitializerScriptableObject providedTimelineInitializer = null)
        {
            if (providedTimelineInitializer == null)
            {
                #region External Dependencies

                this.TimelineInitializer = (TimelineInitializerV3 <NODE_KEY>)TimelineConfigurationGameObject.Get().TimelineConfiguration.ConfigurationInherentData[TimelineID];

                #endregion
            }
            else
            {
                this.TimelineInitializer = (TimelineInitializerV3 <NODE_KEY>)providedTimelineInitializer;
            }


            if (this.isPersisted)
            {
                this.timelinePersister = new ATimelinePersister <ATimelinePersistedNodes <NODE_KEY> >(this.GetType());
                if (this.persistedNodes.Nodes.Count == 0)
                {
                    var loadedNodes = this.timelinePersister.Load();

                    if (loadedNodes.Nodes == null)
                    {
                        InitFromConfig();
                        this.PersistAsync();
                    }
                    else
                    {
                        this.persistedNodes = loadedNodes;
                    }
                }
            }
            else
            {
                InitFromConfig();
            }
        }