示例#1
0
 private void OnFingerUp(AbilityCastType abilityCastType)
 {
     if (m_PlayerActor != null)
     {
         m_PlayerActor.OnFingerUp(abilityCastType);
     }
 }
示例#2
0
    private MobaSkillItem GetSkillItem(AbilityCastType castType)
    {
        MobaSkillItem item;

        m_MobaSkillItemMap.TryGetValue(castType, out item);
        return(item);
    }
示例#3
0
    // 技能范围
    public void OnFingerDown(AbilityCastType castType)
    {
        var abilityActor = GetAbilityActor(castType);

        abilityActor.OnFingerDown();

        battleEntity.PrepareCastAbility(abilityActor.ability);
    }
示例#4
0
    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);
        }
    }
示例#5
0
    public Ability GetAbility(AbilityCastType castType)
    {
        Ability ability;

        m_abilityMap.TryGetValue(castType, out ability);
        if (ability != null)
        {
            return(ability);
        }
        return(null);
    }
示例#6
0
 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);
     }
 }
示例#7
0
    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);
    }
示例#8
0
    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);
    }
示例#9
0
    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();
    }
示例#10
0
    public void OnFingerDrag(AbilityCastType castType, Vector2 mouseDelta)
    {
        var abilityActor = GetAbilityActor(castType);

        abilityActor.OnFingerDrag(mouseDelta);
    }