public override void Load(SpellCaster spellCaster)
 {
     base.Load(spellCaster);
     _lightAndDarknessSpellController =
         GameManager.local.gameObject.GetComponent <LightAndDarknessSpellController>();
     _items = new List <Item>();
 }
        public override IEnumerator OnLoadCoroutine(Level level)
        {
            EventManager.onCreatureSpawn    += EventManagerOnonCreatureSpawn;
            EventManager.onLevelLoad        += EventManagerOnonLevelLoad;
            _lightAndDarknessSpellController =
                GameManager.local.gameObject.GetComponent <LightAndDarknessSpellController>();

            return(base.OnLoadCoroutine(level));
        }
        public override void Update(Level level)
        {
            if (_lightAndDarknessSpellController == null)
            {
                _lightAndDarknessSpellController =
                    GameManager.local.gameObject.GetComponent <LightAndDarknessSpellController>();
                return;
            }

            if (!_lightAndDarknessSpellController.darknessSpellController.isTimeStopped)
            {
                return;
            }
            foreach (var creature in Creature.list)
            {
                if (!creature.isPlayer)
                {
                    if (creature.gameObject.GetComponent <FrozenRagdollCreature>() == null)
                    {
                        creature.gameObject.AddComponent <FrozenRagdollCreature>();
                    }
                    if (creature.gameObject.GetComponent <FrozenAnimationCreature>() == null)
                    {
                        creature.gameObject.AddComponent <FrozenAnimationCreature>();
                    }
                }
            }

            foreach (var item in Item.list)
            {
                if (item.isThrowed || item.isFlying)
                {
                    if (item.gameObject.GetComponent <FrozenItem>() == null)
                    {
                        item.gameObject.AddComponent <FrozenItem>();
                    }
                }
            }
        }
        public void LoadData()
        {
            var jsonInput = File.ReadAllText(GetDataFilePath());

            var savedData =
                JsonConvert.DeserializeObject <LightAndDarknessSpellData>(jsonInput,
                                                                          Catalog.GetJsonNetSerializerSettings());

            lightAndDarknessSpellController =
                GameManager.local.gameObject.AddComponent <LightAndDarknessSpellController>();

            lightAndDarknessSpellController.data = savedData;

            lightAndDarknessSpellController.lightSpellController.angelColor = new Color(
                lightAndDarknessSpellController.data.angelBrightness,
                lightAndDarknessSpellController.data.angelBrightness,
                lightAndDarknessSpellController.data.angelBrightness,
                1
                );

            Debug.Log("Loaded Light And Darkness Spell");
        }