private void OnDestroy()
 {
     StopAllCoroutines();
     if (_Ins == this)
     {
         _Ins = null;
     }
 }
 // Use this for initialization
 void Awake()
 {
     if (_Ins == null)
     {
         _Ins            = this;
         m_CameraControl = GameObject.Find("CameraEx").GetComponent <CameraFollow>();
     }
 }
示例#3
0
    public void Init()
    {
        MeteorResult    = Control("MeteorResult").transform;
        ButterflyResult = Control("ButterflyResult").transform;
        BattleResult    = NodeHelper.Find("BattleResult", WndObject);
        BattleTitle     = NodeHelper.Find("BattleTitle", WndObject);
        Control("Close").SetActive(false);
        Control("SaveRecord").SetActive(false);
        BattleResultAll = NodeHelper.Find("AllResult", WndObject);
        bool active  = CombatData.Ins.GGameMode != GameMode.MENGZHU;
        bool active2 = CombatData.Ins.GGameMode == GameMode.MENGZHU;

        Control("CampImage", WndObject).SetActive(active);
        Control("Title", WndObject).SetActive(active);
        Control("Result", WndObject).SetActive(active);
        Control("CampImage1", WndObject).SetActive(active);
        Control("Title1", WndObject).SetActive(active);
        Control("Result1", WndObject).SetActive(active);
        Control("CampImageAll", WndObject).SetActive(active2);
        Control("TitleAll", WndObject).SetActive(active2);
        Control("ResultAll", WndObject).SetActive(active2);
        GameBattleEx      battle = Main.Ins.GameBattleEx;
        List <MeteorUnit> Units  = MeteorManager.Ins.UnitInfos;

        for (int i = 0; i < Units.Count; i++)
        {
            MeteorUnit unit = Units[i];
            if (unit == null)
            {
                continue;
            }
            if (battle.BattleResult.ContainsKey(unit.InstanceId))
            {
                InsertPlayerResult(unit.InstanceId, battle.BattleResult[unit.InstanceId]);
                battle.BattleResult.Remove(unit.InstanceId);
            }
            else
            {
                InsertPlayerResult(unit.InstanceId, unit.InstanceId, 0, 0, unit.Camp);
            }
        }

        foreach (var each in battle.BattleResult)
        {
            InsertPlayerResult(each.Key, each.Value);
        }
        battle.BattleResult.Clear();
    }