Esempio n. 1
0
    MobaKOInfo AddKoInfo(string desc, string spName, CharacterData dead, CharacterData killer, List <CharacterData> aids, MobaKOInfoType type = MobaKOInfoType.serialKill)
    {
        MobaKOInfo koInfo = new MobaKOInfo();

        koInfo.type            = type;
        koInfo.ShowAid         = aids.Count > 0;
        koInfo.killDesc        = desc;
        koInfo.killSpName      = spName;
        koInfo.decedent        = dead;
        koInfo.killer          = killer;
        koInfo.aids            = aids;
        koInfo.SerialKillCount = killer.mobaSerialKillCount;
        SceneUIManager.instance.MobaKoInfo.KoInfosToPlay.Add(koInfo);
        return(koInfo);
    }
Esempio n. 2
0
    void FadeOut(MobaKOInfo info)
    {
        if (info.type == MobaKOInfoType.firstKill)
        {
            ShowKillEffect(FirstBloodEffect);
        }
        else if (info.type == MobaKOInfoType.serialKill || info.type == MobaKOInfoType.multiKill)
        {
            ShowKillEffect(KillEffect);
        }
        InvokeRepeating("SplashKillEffect", 0f, 0.02f);
        TweenAlpha ta = TweenAlpha.Begin(gameObject, 0.8f, 0f);

        ta.delay = 1.5f;
        // ta.SetOnFinished(() => playing = false);
        EventDelegate.Add(ta.onFinished, () => playing = false, true);
    }
Esempio n. 3
0
    void ShowOneInfo(MobaKOInfo info)
    {
        LaKill.text           = info.killDesc;
        SpKillText.spriteName = info.killSpName;
        SpKillText.MakePixelPerfect();

        if (info.type == MobaKOInfoType.firstKill)
        {
            SpKillerBg.spriteName = "yixuedi";
        }
        else if (info.type == MobaKOInfoType.multiKill || (info.type == MobaKOInfoType.serialKill && info.SerialKillCount > 2) || info.type == MobaKOInfoType.endKill)
        {
            SpKillerBg.spriteName = info.killer.groupIndex == 0 ? "shuangshahongdi" : "shuangshalandi";
        }
        else if (info.type == MobaKOInfoType.allKill)
        {
            SpKillerBg.spriteName = info.killer.groupIndex == 1 ? "shuangshahongdi" : "shuangshalandi";
        }
        else
        {
            SpKillerBg.spriteName = info.killer.groupIndex == 0 ? "hongdi" : "landi";
        }

        SpKillerBorder.spriteName = info.killer.groupIndex == 0 ? "hongkuang" : "lankuang";
        SpDeadBorder.spriteName   = info.decedent.groupIndex == 0 ? "hongkuang" : "lankuang";
        SpKillerBg.MakePixelPerfect();
        string containGroupIndex = BattleUtil.IsHeroTarget(info.killer) ? "" : "" + info.killer.groupIndex;

        SpKillerHead.spriteName = info.killer.attrNode.icon_name + containGroupIndex + "_head";
        SpDeadHead.spriteName   = info.decedent.attrNode.icon_name + "_head";
        for (int i = 0; i < SpAidHeads.Length; i++)
        {
            SpAidHeads[i].gameObject.SetActive(false);
        }
        for (int j = 0; j < info.aids.Count; j++)
        {
            SpAidHeads[j].spriteName = info.aids[j].attrNode.icon_name + "_head";
            SpAidHeads[j].gameObject.SetActive(true);
        }

        bool showDead = info.type != MobaKOInfoType.allKill && info.type != MobaKOInfoType.towerKill && info.type != MobaKOInfoType.chaoshenKill;

        SpKillerHead.gameObject.SetActive(info.type != MobaKOInfoType.allKill);
        SpDeadHead.gameObject.SetActive(showDead);
        SpKillEffect.gameObject.SetActive(showDead);
        WdAid.gameObject.SetActive(info.ShowAid);

        SpKillEffect.fillAmount = 0f;

        TweenAlpha ta = TweenAlpha.Begin(gameObject, 0.7f, 1f);

        EventDelegate.Add(ta.onFinished, () => FadeOut(info), true);

        SpDeadHead.transform.localPosition   = new Vector3(240f, 0f, 0f);
        SpKillerHead.transform.localPosition = new Vector3(-240f, 0f, 0f);
        TweenPosition.Begin(SpDeadHead.gameObject, 0f, new Vector3(240f, 0f, 0f));
        TweenPosition.Begin(SpKillerHead.gameObject, 0f, new Vector3(-240f, 0f, 0f));
        float pos = info.type == MobaKOInfoType.towerKill ? 180f : 140f;

        TweenPosition.Begin(SpDeadHead.gameObject, 0.4f, new Vector3(pos, 0f, 0f)).delay    = 0.1f;
        TweenPosition.Begin(SpKillerHead.gameObject, 0.4f, new Vector3(-pos, 0f, 0f)).delay = 0.1f;
    }