예제 #1
0
    void ForciblySummonGuide(TOUCH_KEY key)
    {
        SkillBtnCD summonBtn = null;

        switch (key)
        {
        case TOUCH_KEY.Summon1:
            summonBtn = fightTouchIns.summon1;
            break;

        case TOUCH_KEY.Summon2:
            summonBtn = fightTouchIns.summon2;
            break;

        case TOUCH_KEY.Summon3:
            summonBtn = fightTouchIns.summon3;
            break;
        }

        if (null == summonBtn)
        {
            Debug.Log("summonBtn is null");
            return;
        }

        copyBtn = Instantiate(summonBtn.gameObject) as GameObject;

        if (null == copyBtn)
        {
            Debug.Log("copyBtn is null");
            return;
        }
        copyBtn.transform.parent     = mask.transform;
        copyBtn.transform.localScale = Vector3.one;
        copyBtn.transform.position   = summonBtn.transform.position;
        copyBtn.transform.FindComponent <UISprite>("CD").enabled = false;
        ShowGuide(copyBtn.transform);

        if (mask.activeSelf)
        {
            mask.transform.Find("Sprite").GetComponent <UISprite>().alpha = 1f;
        }
        else
        {
            mask.SetActive(true);
        }

        fightTouchIns.CopySummonBtn(copyBtn.GetComponent <SkillBtnCD>(), key);

        for (int i = 0; i < elite.Count; i++)
        {
            elite[i].GetComponent <CharacterState>().moveSpeed = 0;
        }

        player.moveSpeed = 0;
    }
예제 #2
0
    List <float> GetCds()
    {
        List <float> ret  = new List <float>();
        List <long>  sids = playerCS.GetSkills();

        for (int i = 0; i < sids.Count; i++)
        {
            SkillBtnCD sBtn = FightTouch._instance.GetSkillBtnBySkillId(sids[i]);
            //if(sBtn != null)
            ret.Add(sBtn.CD);
        }
        return(ret);
    }
예제 #3
0
    void InitSkillBtnState(SkillBtnCD skillBtn, int index)
    {
        SkillNode skillNode = GetSkillNodeBySeat(index);

        if (skillNode != null)
        {
            skillBtn.index     = skillNode.site;
            skillBtn.skillNode = skillNode;
            skillBtn.SetCd(skillNode.cooling);
#if UNITY_EDITOR
            skillBtn.SetCd(1);
#endif
            skillBtn.IconSprite.spriteName = skillNode.skill_icon;
            skillBtn.onPressed             = OnClickSkillBtn;
        }
    }
예제 #4
0
    public void CopySummonBtn(SkillBtnCD summonBtn, TOUCH_KEY key)
    {
        switch (key)
        {
        case TOUCH_KEY.Summon1:
            InitSummonBtnState(summonBtn, 5);
            break;

        case TOUCH_KEY.Summon2:
            InitSummonBtnState(summonBtn, 6);
            break;

        case TOUCH_KEY.Summon3:
            InitSummonBtnState(summonBtn, 7);
            break;
        }
    }
예제 #5
0
    void InitSummonBtnState(SkillBtnCD summonBtn, int index)
    {
        summonBtn.index = index;
        HeroData hd = Globe.Heros()[index - 4];

        if (null == hd || hd.id == 0)
        {
            summonBtn.GetComponent <UISprite>().spriteName = "";
        }
        else
        {
            summonBtn.SetCd(Globe.isFightGuide ? 1 : 30);
#if UNITY_EDITOR
            summonBtn.SetCd(1);
#endif
            summonBtn.onPressed = OnSummon;
            summonBtn.GetComponent <UISprite>().spriteName = hd.node.icon_name;
        }
    }