Пример #1
0
 private void OnSkillCooldownStart(ESkillKey skillKey, float duration)
 {
     if (skillKey == _skillKey)
     {
         _cooldown.StartCooldown(duration);
     }
 }
Пример #2
0
 public void UseSkill(ESkillKey skillKey)
 {
     if (FightManager.SceneInstance.Status == EFightStatus.InProgress && _skills.ContainsKey(skillKey) && _skills[skillKey] != null)
     {
         _skills[skillKey].Use(this);
     }
 }
	public void SetSkillIndex(EUnitKey heroKey, ESkillKey skillKey, int index) {
		List<ESkillKey> heroSkills = GetHeroSkillsInternal(heroKey);
		if (index < 0 || index >= heroSkills.Count) {
			return;
		}
		if (heroSkills.IndexOf(skillKey) != -1 && heroSkills.IndexOf(skillKey) != index) {
			heroSkills.Remove(skillKey);
			heroSkills.Insert(index, skillKey);
		}
	}
	public void AddSkill(EUnitKey heroKey, ESkillKey skillKey) {
		List<ESkillKey> heroSkills = GetHeroSkillsInternal(heroKey);
		if (heroSkills.Count >= _maxSkillsAmount) {
			return;
		}
		if (heroSkills.IndexOf(skillKey) != -1) {
			return;
		}
		heroSkills.Add(skillKey);
	}
Пример #5
0
 public SkillParameters GetSkillParameters(ESkillKey skillKey)
 {
     for (int i = 0; i < _skillsData.Length; i++)
     {
         if (_skillsData[i].Key == skillKey)
         {
             return(_skillsData[i]);
         }
     }
     return(null);
 }
	public override void PlaySkillAnimation(ESkillKey skillKey, params object[] data) {
		switch (skillKey) {
			case ESkillKey.ClipDischarge:
				PlaySkillClipDischargeAnimation((float)data[0]);
				break;
			case ESkillKey.ExplosiveCharges:
				PlaySkillExplosiveChargesAnimation();
				break;
			case ESkillKey.StunGrenade:
				PlaySkillStunGrenadeAnimation();
				break;
		}
	}
Пример #7
0
    public void AddSkill(EUnitKey heroKey, ESkillKey skillKey)
    {
        List <ESkillKey> heroSkills = GetHeroSkillsInternal(heroKey);

        if (heroSkills.Count >= _maxSkillsAmount)
        {
            return;
        }
        if (heroSkills.IndexOf(skillKey) != -1)
        {
            return;
        }
        heroSkills.Add(skillKey);
    }
Пример #8
0
    public void SetSkillIndex(EUnitKey heroKey, ESkillKey skillKey, int index)
    {
        List <ESkillKey> heroSkills = GetHeroSkillsInternal(heroKey);

        if (index < 0 || index >= heroSkills.Count)
        {
            return;
        }
        if (heroSkills.IndexOf(skillKey) != -1 && heroSkills.IndexOf(skillKey) != index)
        {
            heroSkills.Remove(skillKey);
            heroSkills.Insert(index, skillKey);
        }
    }
	public void Setup(SkillParameters skillParams) {
		_skillKey = skillParams.Key;
		_aggroCost = skillParams.AggroCrystalsCost;

		if (!skillParams.IconPath.Equals(string.Empty)) {
			Sprite skillSprite = UIResourcesManager.Instance.GetResource<Sprite>(string.Format("{0}/{1}", GameConstants.Paths.UI_ABILITY_ICONS_RESOURCES, skillParams.IconPath));
			if (skillSprite != null) {
				_imgAbilitiIcon.sprite = skillSprite;
				_imgAbilitiIcon.gameObject.SetActive(true);
			}
		}

		if (_txtAbilityCost != null) {
			_txtAbilityCost.text = _aggroCost.ToString();
		}
	}
Пример #10
0
    public override void PlaySkillAnimation(ESkillKey skillKey, params object[] data)
    {
        switch (skillKey)
        {
        case ESkillKey.ClipDischarge:
            PlaySkillClipDischargeAnimation((float)data[0]);
            break;

        case ESkillKey.ExplosiveCharges:
            PlaySkillExplosiveChargesAnimation();
            break;

        case ESkillKey.StunGrenade:
            PlaySkillStunGrenadeAnimation();
            break;
        }
    }
Пример #11
0
    public void Setup(SkillParameters skillParams)
    {
        _skillKey  = skillParams.Key;
        _aggroCost = skillParams.AggroCrystalsCost;

        if (!skillParams.IconPath.Equals(string.Empty))
        {
            Sprite skillSprite = UIResourcesManager.Instance.GetResource <Sprite>(string.Format("{0}/{1}", GameConstants.Paths.UI_ABILITY_ICONS_RESOURCES, skillParams.IconPath));
            if (skillSprite != null)
            {
                _imgAbilitiIcon.sprite = skillSprite;
                _imgAbilitiIcon.gameObject.SetActive(true);
            }
        }

        if (_txtAbilityCost != null)
        {
            _txtAbilityCost.text = _aggroCost.ToString();
        }
    }
Пример #12
0
	public void AddSkill(EUnitKey heroKey, ESkillKey skillKey, int index) {
		AddSkill(heroKey, skillKey);
		SetSkillIndex(heroKey, skillKey, index);
	}
Пример #13
0
    public void  RemoveSkill(EUnitKey heroKey, ESkillKey skillKey)
    {
        List <ESkillKey> heroSkills = GetHeroSkillsInternal(heroKey);

        heroSkills.Remove(skillKey);
    }
Пример #14
0
	public void  RemoveSkill(EUnitKey heroKey, ESkillKey skillKey) {
		List<ESkillKey> heroSkills = GetHeroSkillsInternal(heroKey);
		heroSkills.Remove(skillKey);
	}
Пример #15
0
 public void AddSkill(EUnitKey heroKey, ESkillKey skillKey, int index)
 {
     AddSkill(heroKey, skillKey);
     SetSkillIndex(heroKey, skillKey, index);
 }
Пример #16
0
 public void UseSkill(ESkillKey skillKey)
 {
     if (FightManager.SceneInstance.Status == EFightStatus.InProgress && _skills.ContainsKey(skillKey) && _skills[skillKey] != null) {
         _skills[skillKey].Use(this);
     }
 }
Пример #17
0
	public virtual void PlaySkillAnimation(ESkillKey skillKey, params object[] data) { }
	private void OnSkillCooldownStart(ESkillKey skillKey, float duration) {
		if (skillKey == _skillKey) {
			_cooldown.StartCooldown(duration);
		}
	}
Пример #19
0
 public virtual void PlaySkillAnimation(ESkillKey skillKey, params object[] data)
 {
 }