Пример #1
0
        public static Clicker CreateNew(EntityInstancePlugin plugin, ILevelManager level)
        {
            var newInstance = new Clicker(level);

            plugin.Entity.AddComponent(newInstance);

            return(newInstance);
        }
Пример #2
0
            public static StDefaultComponent SaveState(Clicker clicker)
            {
                var storedClicker = new StClicker
                {
                    Enabled = clicker.Enabled
                };

                return(new StDefaultComponent {
                    Clicker = storedClicker
                });
            }
Пример #3
0
            public override void StartLoading()
            {
                if (storedData.ComponentCase != StDefaultComponent.ComponentOneofCase.Clicker)
                {
                    throw new ArgumentException("Invalid component type data passed to loader", nameof(storedData));
                }

                var storedClicker = storedData.Clicker;

                Clicker = new Clicker(level)
                {
                    Enabled = storedClicker.Enabled
                };
            }