public override void OnEvent(CooldownEvent evnt) { if (!this.IsCooldown) { this.IsCooldown = true; this.currentCooldownLaunchSeed = Time.time + evnt.Durantion; } }
protected void generateCooldownEvent(Ability ability, float eventStartTime) { var e = new CooldownEvent { eventTime = eventStartTime + ability.cooldown, ability = ability, owner = this }; EventQueueSingleton.queue.add(e); }
private void ParseCooldown(Dictionary <Event, List <Action> > events, XDocument xml) { var root = xml.Root; var default_active = root.Attribute("active")?.Value ?? "True"; var default_priority = root.Attribute("priority")?.Value ?? "5"; foreach (var abnormality in root.Elements("cooldown")) { var skillId = int.Parse(abnormality.Attribute("skill_id").Value); var onlyResetted = bool.Parse(abnormality.Attribute("only_resetted")?.Value ?? "True"); var active = bool.Parse(abnormality.Attribute("active")?.Value ?? default_active); var ingame = bool.Parse(abnormality.Attribute("ingame").Value); var priority = int.Parse(abnormality.Attribute("priority")?.Value ?? default_priority); ParseAreaBossBlackList(abnormality); var cooldownEvent = new CooldownEvent(ingame, active, priority, skillId, onlyResetted); events.Add(cooldownEvent, new List <Action>()); ParseActions(abnormality, events, cooldownEvent, EventType.Cooldown); } }