private void OnFingerUp(AbilityCastType abilityCastType) { if (m_PlayerActor != null) { m_PlayerActor.OnFingerUp(abilityCastType); } }
private MobaSkillItem GetSkillItem(AbilityCastType castType) { MobaSkillItem item; m_MobaSkillItemMap.TryGetValue(castType, out item); return(item); }
// 技能范围 public void OnFingerDown(AbilityCastType castType) { var abilityActor = GetAbilityActor(castType); abilityActor.OnFingerDown(); battleEntity.PrepareCastAbility(abilityActor.ability); }
private void OnFingerDrag(AbilityCastType abilityCastType, Vector2 mouseDelta) { //Debug.RawLog(mouseDelta); //var originPos = m_PlayerActor.transform.position; //skillForward.Set(originPos.x + mouseDelta.x, originPos.y, originPos.z + mouseDelta.y); if (m_PlayerActor != null) { m_PlayerActor.OnFingerDrag(abilityCastType, mouseDelta); } }
public Ability GetAbility(AbilityCastType castType) { Ability ability; m_abilityMap.TryGetValue(castType, out ability); if (ability != null) { return(ability); } return(null); }
private void OnCastAbility(AbilityCastType castType) { if (m_PlayerUnit != null) { Ability ability = m_PlayerUnit.GetAbility(castType); if (ability.CD > 0) { GameLog.Log("冷却中"); return; } m_PlayerUnit.CastAbility(ability); } }
public void OnFingerUp(AbilityCastType castType) { var abilityActor = GetAbilityActor(castType); abilityActor.OnFingerUp(); Ability ability = battleEntity.GetAbility(castType); if (ability.CD > 0) { GameLog.Log("冷却中"); return; } battleEntity.CastAbility(ability); }
private AbilityActor GetAbilityActor(AbilityCastType castType) { Ability ability = battleEntity.GetAbility(castType); if (m_abilityActorMap == null) { m_abilityActorMap = new Dictionary <AbilityCastType, AbilityActor>(4); } AbilityActor abilityActor; if (m_abilityActorMap.TryGetValue(castType, out abilityActor)) { return(abilityActor); } abilityActor = new AbilityActor(ability, transform); m_abilityActorMap[castType] = abilityActor; return(abilityActor); }
public void Init(AbilityCastType castType, Ability ability, Action <AbilityCastType> downAction , Action <AbilityCastType, Vector2> dragAction, Action <AbilityCastType> upAction) { m_joystick.name = "JoystickSkillItem" + castType.ToString(); m_downAction = downAction; m_dragAction = dragAction; m_upAction = upAction; m_ability = ability; m_skillID = ability.ID; m_abilityCastType = castType; skillItem skillItem = skillTable.Instance.GetTableItem(m_skillID); string iconName = skillItem.icon; iconName = "skill/" + iconName;//todo 导出动态图片映射表 ImageEx ImgIcon = (ImageEx)UI["ImgIcon"]; ImgIcon.SetSprite(iconName); m_txtCD = (TextMeshProUGUI)UI["TxtCD"]; m_imgCDMask = (Image)UI["ImgCDMask"]; SetCDState(); }
public void OnFingerDrag(AbilityCastType castType, Vector2 mouseDelta) { var abilityActor = GetAbilityActor(castType); abilityActor.OnFingerDrag(mouseDelta); }