private void OnLoadComplete()
 {
     TrainManager.Instance.Load();
     if (MyInfoManager.Instance.BreakingInto)
     {
         GameObject gameObject = GameObject.Find("Main");
         if (null != gameObject)
         {
             string text = StringMgr.Instance.Get("WATCHING_USER_CHANGE");
             gameObject.BroadcastMessage("OnChat", new ChatText(ChatText.CHAT_TYPE.SYSTEM, -1, string.Empty, text));
         }
         GlobalVars.Instance.senseBombInit();
         MyInfoManager.Instance.ControlMode = MyInfoManager.CONTROL_MODE.PLAYING_SPECTATOR;
         localController.ResetGravity();
         GlobalVars.Instance.battleStarting = false;
         CSNetManager.Instance.Sock.SendCS_ZOMBIE_OBSERVER_REQ();
     }
     else
     {
         SpawnerDesc spawner = BrickManager.Instance.GetSpawner(Brick.SPAWNER_TYPE.SINGLE_SPAWNER, MyInfoManager.Instance.Ticket);
         if (spawner != null)
         {
             localController.Spawn(spawner.position, Rot.ToQuaternion(spawner.rotation));
         }
         else
         {
             localController.Spawn(BrickManager.Instance.GetRandomSpawnPos(), Rot.ToQuaternion((byte)UnityEngine.Random.Range(0, 4)));
         }
     }
     if (!MyInfoManager.Instance.GetCommonMask(MyInfoManager.COMMON_OPT.DONOT_ZOMBIE_GUIDE))
     {
         ZombieGuideDialog zombieGuideDialog = (ZombieGuideDialog)DialogManager.Instance.GetDialogAlways(DialogManager.DIALOG_INDEX.ZOMBIE_GUIDE);
         if (zombieGuideDialog != null && !zombieGuideDialog.DontShowThisMessageAgain)
         {
             ((ZombieGuideDialog)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.ZOMBIE_GUIDE, exclusive: false))?.InitDialog();
         }
     }
 }
    private void OnLoadComplete()
    {
        TrainManager.Instance.Load();
        for (int i = 0; i < 2; i++)
        {
            SpawnerDesc spawner = BrickManager.Instance.userMap.GetSpawner(Brick.SPAWNER_TYPE.BOMB_SPAWNER, i);
            if (spawner == null)
            {
                Debug.LogError("Fail to find BOMB SPAWNER from the geometry ");
            }
            else
            {
                GameObject brickObjectByPos = BrickManager.Instance.GetBrickObjectByPos(spawner.position);
                if (null != brickObjectByPos)
                {
                    BrickProperty component = brickObjectByPos.GetComponent <BrickProperty>();
                    if (null == component)
                    {
                        Debug.LogError("<BombObj> get BrickProperty failed..");
                    }
                    else
                    {
                        coreObjs[i].transform.position = spawner.position;
                        coreObjs[i].transform.rotation = brickObjectByPos.transform.rotation;
                        coreObjs[i].GetComponent <BlastTarget>().Spot = component.Seq;
                    }
                }
            }
        }
        bool flag = false;

        if (MyInfoManager.Instance.BreakingInto && MyInfoManager.Instance.BlastModeDesc != null)
        {
            if (MyInfoManager.Instance.BlastModeDesc.rounding)
            {
                step          = STEP.NOTHING;
                bombInstaller = -1;
                blastTarget   = -1;
                flag          = false;
            }
            else if (MyInfoManager.Instance.BlastModeDesc.bombInstaller < 0 || MyInfoManager.Instance.BlastModeDesc.blastTarget < 0)
            {
                step          = STEP.NOTHING;
                bombInstaller = -1;
                blastTarget   = -1;
                flag          = true;
            }
            else
            {
                step          = STEP.INSTALLED;
                bombInstaller = MyInfoManager.Instance.BlastModeDesc.bombInstaller;
                blastTarget   = MyInfoManager.Instance.BlastModeDesc.blastTarget;
                clockBomb.Install(MyInfoManager.Instance.BlastModeDesc.point, MyInfoManager.Instance.BlastModeDesc.normal);
                flag = true;
            }
            MyInfoManager.Instance.BlastModeDesc = null;
        }
        if (flag)
        {
            GlobalVars.Instance.battleStarting = false;
            GlobalVars.Instance.senseBombInit();
            GameObject gameObject = GameObject.Find("Main");
            if (null != gameObject)
            {
                string text = StringMgr.Instance.Get("WATCHING_USER_CHANGE");
                gameObject.BroadcastMessage("OnChat", new ChatText(ChatText.CHAT_TYPE.SYSTEM, -1, string.Empty, text));
            }
            MyInfoManager.Instance.ControlMode = MyInfoManager.CONTROL_MODE.PLAYING_SPECTATOR;
            localController.ResetGravity();
        }
        else
        {
            SpawnerDesc spawner2 = BrickManager.Instance.GetSpawner(MyInfoManager.Instance.GetTeamSpawnerType(), MyInfoManager.Instance.Ticket);
            if (spawner2 != null)
            {
                localController.Spawn(spawner2.position, Rot.ToQuaternion(spawner2.rotation));
            }
            else
            {
                localController.Spawn(BrickManager.Instance.GetRandomSpawnPos(), Rot.ToQuaternion((byte)UnityEngine.Random.Range(0, 4)));
            }
        }
        if (bRedTeam)
        {
            if (!MyInfoManager.Instance.GetCommonMask(MyInfoManager.COMMON_OPT.DONOT_EXPLOSION_ATTACK_GUIDE))
            {
                ExplosionAttackGuideDialog explosionAttackGuideDialog = (ExplosionAttackGuideDialog)DialogManager.Instance.GetDialogAlways(DialogManager.DIALOG_INDEX.EXPLOSION_ATTACK_GUIDE);
                if (explosionAttackGuideDialog != null && !explosionAttackGuideDialog.DontShowThisMessageAgain)
                {
                    ((ExplosionAttackGuideDialog)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.EXPLOSION_ATTACK_GUIDE, exclusive: false))?.InitDialog();
                }
            }
        }
        else if (!MyInfoManager.Instance.GetCommonMask(MyInfoManager.COMMON_OPT.DONOT_EXPLOSION_DEFENCE_GUIDE))
        {
            ExplosionDefenceGuideDialog explosionDefenceGuideDialog = (ExplosionDefenceGuideDialog)DialogManager.Instance.GetDialogAlways(DialogManager.DIALOG_INDEX.EXPLOSION_DEFENCE_GUIDE);
            if (explosionDefenceGuideDialog != null && !explosionDefenceGuideDialog.DontShowThisMessageAgain)
            {
                ((ExplosionDefenceGuideDialog)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.EXPLOSION_DEFENCE_GUIDE, exclusive: false))?.InitDialog();
            }
        }
    }