Exemplo n.º 1
0
 public static void OnFightReport(proto.S2CFightReport msg)
 {
     if (EventOnFightReport != null)
     {
         EventOnFightReport(msg);
     }
 }
Exemplo n.º 2
0
    /// <summary>
    /// 显示战损单位信息
    /// </summary>
    /// <param name="result"></param>
    /// <returns></returns>
    private IEnumerator ShowLostUnits(proto.S2CFightReport result)
    {
        int lostUnitSize = result.lostunit_size();

        if (lostUnitSize == 0)
        {
            NoLostNoteText_.enabled = true;
            NoLostNoteText_.text    = "No unit loss, congratulation!";
            yield break;
        }
        for (int i = 0; i < lostUnitSize; i++)
        {
            proto.LostUnitInfo info     = result.lostunit(i);
            string             iconName = GlobalConfig.GetUnitReference(info.refid).iconfile;
            Debug.Log("lost iocnName : " + iconName);
            GameObject obj = Global.CreateUI("lostunit", LostUnitContentRoot_.gameObject);
            obj.name = string.Format("_lost_id_{0}", info.refid);
            Image iconImg    = obj.GetComponent <Image>();
            Text  amountText = obj.GetComponentInChildren <Text>();
            Global.SetSprite(iconImg, iconName, true);
            amountText.text = string.Format("x{0}", info.amount);

            yield return(new WaitForSeconds(0.5f));
        }
        yield return(null);
    }
Exemplo n.º 3
0
    /// <summary>
    /// 显示战报
    /// </summary>
    /// <param name="result"></param>
    /// <returns></returns>
    private IEnumerator ShowFightReport(proto.S2CFightReport result)
    {
        yield return(new WaitForSeconds(5.5f));

        AudioManager.Instance.PlayMusic = false;
        yield return(new WaitForSeconds(0.5f));

        // 播放战斗胜利和失败的音效的代码先放这个地方。
        if (result.fightresult == proto.S2CFightReport.Result.Fail)
        {
            Global.PlaySound("res/audio/youlose.audio", Vector3.zero, false);
        }
        else
        {
            Global.PlaySound("res/audio/youwin.audio", Vector3.zero, false);
        }
        UIManager.ShowPanel <BattleResultPanel>(result);
    }
Exemplo n.º 4
0
    private IEnumerator ShowResultSequence(proto.S2CFightReport result)
    {
        if (result == null)
        {
            Debug.LogError("ShowResultSequence(), RESULT IS NULL!");
            yield break;
        }
        Debug.Log("ShowResultSequence(), result : " + result.fightresult.ToString());

        yield return(new WaitForSeconds(ANIM_SHOW_DURATION)); //等待面板动画显示完成

        StartCoroutine(ShowTitle(result.fightresult));
        StartCoroutine(ShowDestoryRatio(result.destroyratio));
        StartCoroutine(ShowGotEnergy(result.energy));
        StartCoroutine(ShowGotCapital(result.capital));
        StartCoroutine(ShowExp(result.exp));
        StartCoroutine(ShowExtraExp(result.extraexp));
        StartCoroutine(ShowMdeal(result.mdeal));
        StartCoroutine(ShowGrade(result.grade));
        StartCoroutine(ShowLostUnits(result));
    }
Exemplo n.º 5
0
 private void BattleSys_EventOnFightReport(proto.S2CFightReport obj)
 {
     StartCoroutine(ShowFightReport(obj));
 }
Exemplo n.º 6
0
 private FightAnalyzer()
 {
     ReportMsg_ = new proto.S2CFightReport();
 }