示例#1
0
    private void OnGetBack2Spawner()
    {
        step      = STEP.CHANGED;
        count     = 0;
        deltaTime = 0f;
        SpawnerDesc spawner = BrickManager.Instance.GetSpawner(MyInfoManager.Instance.GetRoundingSpawnerType(), MyInfoManager.Instance.Ticket);

        if (spawner != null)
        {
            VerifyLocalController();
            if (clockbombkill)
            {
                if (equipcoord != null)
                {
                    equipcoord.DeleteClcokBomb();
                }
                clockbombkill = false;
            }
            GlobalVars.Instance.DropedWeaponAllClear();
            PaletteManager.Instance.Switch(on: false);
            if (localController != null)
            {
                localController.Respawn(spawner.position, Rot.ToQuaternion(spawner.rotation));
            }
            VoiceManager.Instance.Play("Ingame_Ready_combo_1");
        }
    }
示例#2
0
    private void CreateAwardees()
    {
        BrickManManager.Instance.ClearBrickManEtc();
        Brick.SPAWNER_TYPE sPAWNER_TYPE  = Brick.SPAWNER_TYPE.RED_TEAM_SPAWNER;
        Brick.SPAWNER_TYPE sPAWNER_TYPE2 = Brick.SPAWNER_TYPE.BLUE_TEAM_SPAWNER;
        int num = 0;

        for (int i = 0; i < RoomManager.Instance.RU.Length; i++)
        {
            BrickManDesc brickManDesc = BrickManManager.Instance.GetDesc(RoomManager.Instance.RU[i].seq);
            if (brickManDesc == null && RoomManager.Instance.RU[i].seq == MyInfoManager.Instance.Seq)
            {
                brickManDesc = new BrickManDesc(MyInfoManager.Instance.Seq, MyInfoManager.Instance.Nickname, MyInfoManager.Instance.GetUsings(), 0, MyInfoManager.Instance.Xp, MyInfoManager.Instance.ClanSeq, MyInfoManager.Instance.ClanName, MyInfoManager.Instance.ClanMark, MyInfoManager.Instance.Rank, null, null);
            }
            if (brickManDesc != null)
            {
                GameObject gameObject = BrickManManager.Instance.AddBrickMan(brickManDesc);
                if (null != gameObject)
                {
                    SpawnerDesc awardSpawner4TeamMatch = BrickManager.Instance.GetAwardSpawner4TeamMatch((num >= 8) ? sPAWNER_TYPE2 : sPAWNER_TYPE, num++);
                    if (awardSpawner4TeamMatch != null)
                    {
                        gameObject.transform.position = new Vector3(awardSpawner4TeamMatch.position.x, awardSpawner4TeamMatch.position.y - 0.5f, awardSpawner4TeamMatch.position.z);
                        gameObject.transform.rotation = Rot.ToQuaternion(awardSpawner4TeamMatch.rotation);
                    }
                }
            }
        }
    }
示例#3
0
 private void Start()
 {
     newBrick = BrickManager.Instance.GetBrick(brick);
     if (newBrick == null)
     {
         Debug.LogError("ERROR, Fail to get Brick Template. Trying to start BrickCreator with invalid brick ");
     }
     deltaTime = 0f;
     base.transform.rotation = Rot.ToQuaternion(rot);
     cube = base.transform.Find("Cube");
     if (cube != null)
     {
         Vector3 size   = new Vector3(1f, 1f, 1f);
         Vector3 center = Vector3.zero;
         BrickManager.Instance.FetchCenterAndSize(brick, ref center, ref size);
         cube.transform.localPosition = center;
         cube.transform.localScale    = new Vector3(0.01f, 0.01f, 0.01f);
         UniformedScaler component = cube.GetComponent <UniformedScaler>();
         if (null != component)
         {
             component.targetScale = size;
         }
         boxCollider = GetComponent <BoxCollider>();
         if (null == boxCollider)
         {
             Debug.LogError("Brick Creator doesnot have box collider");
         }
         else
         {
             boxCollider.size   = size;
             boxCollider.center = new Vector3(0f, size.y / 2f - 0.5f, 0f);
         }
     }
 }
示例#4
0
    private void OnLoadComplete()
    {
        TrainManager.Instance.Load();
        if (MyInfoManager.Instance.BreakingInto && MyInfoManager.Instance.BndModeDesc != null)
        {
            timer.IsBuildPhase = MyInfoManager.Instance.BndModeDesc.buildPhase;
            MyInfoManager.Instance.BndModeDesc = null;
        }
        ResetBndStatus(wallRightNow: true);
        SpawnerDesc spawner = BrickManager.Instance.GetSpawner(MyInfoManager.Instance.GetTeamSpawnerType(), 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_BND_GUIDE))
        {
            BNDGuideDialog bNDGuideDialog = (BNDGuideDialog)DialogManager.Instance.GetDialogAlways(DialogManager.DIALOG_INDEX.BND_GUIDE);
            if (bNDGuideDialog != null && !bNDGuideDialog.DontShowThisMessageAgain)
            {
                ((BNDGuideDialog)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.BND_GUIDE, exclusive: false))?.InitDialog();
            }
        }
    }
示例#5
0
    private void Update()
    {
        bool       flag      = false;
        Connecting component = GetComponent <Connecting>();

        if (null != component)
        {
            flag = component.Show;
        }
        Screen.lockCursor = (!Application.isLoadingLevel && !battleChat.IsChatting && !DialogManager.Instance.IsModal && !flag);
        if (delayLoad)
        {
            deltaTime += Time.deltaTime;
            if (deltaTime > 1f)
            {
                delayLoad = false;
                StartLoad();
            }
        }
        else if (!Application.isLoadingLevel)
        {
            if (!battleChat.IsChatting && BrickManager.Instance.IsLoaded && custom_inputs.Instance.GetButtonDown("K_MAIN_MENU") && !DialogManager.Instance.IsPopup(DialogManager.DIALOG_INDEX.MENU_EX) && GlobalVars.Instance.IsMenuExOpenOk())
            {
                ((MenuEx)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.MENU_EX, exclusive: true))?.InitDialog();
                if (MyInfoManager.Instance.Seq == RoomManager.Instance.Master)
                {
                    BrickManDesc[] array = BrickManManager.Instance.ToDescriptorArrayWhoTookTooLongToWait();
                    if (array != null && array.Length > 0)
                    {
                        DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.KICK, exclusive: false);
                    }
                }
            }
            if (custom_inputs.Instance.GetButtonDown("K_HELP") && !DialogManager.Instance.IsModal && GlobalVars.Instance.IsMenuExOpenOk() && !battleChat.IsChatting)
            {
                DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.HELPWINDOW, exclusive: true);
            }
            GlobalVars.Instance.UpdateFlashbang();
            if (isGoalRespawn)
            {
                goalRespawnTime += Time.deltaTime;
                if (goalRespawnTime > 5f)
                {
                    isGoalRespawn = false;
                    EscapeGoalTrigger.GoalSendReset();
                    SpawnerDesc spawner = BrickManager.Instance.GetSpawner(Brick.SPAWNER_TYPE.SINGLE_SPAWNER, MyInfoManager.Instance.Ticket);
                    if (spawner != null)
                    {
                        localController.Spawn(spawner.position, Rot.ToQuaternion(spawner.rotation));
                    }
                }
            }
        }
    }
 private void OnLoadComplete()
 {
     TrainManager.Instance.Load();
     localController.Spawn(BrickManager.Instance.GetRandomSpawnPos(), Rot.ToQuaternion((byte)UnityEngine.Random.Range(0, 4)));
     bLoaded = true;
     if (!MyInfoManager.Instance.GetCommonMask(MyInfoManager.COMMON_OPT.DONOT_BUNGEE_GUIDE))
     {
         BungeeGuideDialog bungeeGuideDialog = (BungeeGuideDialog)DialogManager.Instance.GetDialogAlways(DialogManager.DIALOG_INDEX.BUNGEE_GUIDE);
         if (bungeeGuideDialog != null && !bungeeGuideDialog.DontShowThisMessageAgain)
         {
             ((BungeeGuideDialog)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.BUNGEE_GUIDE, exclusive: false))?.InitDialog();
         }
     }
 }
示例#7
0
 private void OnLoadComplete()
 {
     CSNetManager.Instance.Sock.SendCS_RESUME_ROOM_REQ(2);
     localController.Spawn(BrickManager.Instance.GetRandomSpawnPos(), Rot.ToQuaternion((byte)UnityEngine.Random.Range(0, 4)));
     bLoaded = true;
     if (!MyInfoManager.Instance.GetCommonMask(MyInfoManager.COMMON_OPT.DONOT_MAPEDIT_GUIDE))
     {
         MapEditGuideDialog mapEditGuideDialog = (MapEditGuideDialog)DialogManager.Instance.GetDialogAlways(DialogManager.DIALOG_INDEX.BUILD_GUIDE);
         if (mapEditGuideDialog != null && !mapEditGuideDialog.DontShowThisMessageAgain)
         {
             ((MapEditGuideDialog)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.BUILD_GUIDE, exclusive: false))?.InitDialog();
         }
     }
 }
示例#8
0
    private void OnLoadComplete()
    {
        TrainManager.Instance.Load();
        BrickManManager.Instance.InitFlagVars();
        SpawnerDesc spawner = BrickManager.Instance.GetSpawner(MyInfoManager.Instance.GetTeamSpawnerType(), 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_FLAG_GUIDE))
        {
            FLAGGuideDialog fLAGGuideDialog = (FLAGGuideDialog)DialogManager.Instance.GetDialogAlways(DialogManager.DIALOG_INDEX.FLAG_GUIDE);
            if (fLAGGuideDialog != null && !fLAGGuideDialog.DontShowThisMessageAgain)
            {
                ((FLAGGuideDialog)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.FLAG_GUIDE, exclusive: false))?.InitDialog();
            }
        }
        SpawnerDesc spawner2 = BrickManager.Instance.userMap.GetSpawner(Brick.SPAWNER_TYPE.FLAG_SPAWNER, 0);

        FlagObj.transform.position     = new Vector3(spawner2.position.x, spawner2.position.y - 0.3f, spawner2.position.z);
        BrickManManager.Instance.vFlag = FlagObj.transform.position;
        rbPlanes[2].transform.position = spawner2.position;
        spawner2 = BrickManager.Instance.userMap.GetSpawner(Brick.SPAWNER_TYPE.RED_FLAG_SPAWNER, 0);
        rbPlanes[0].transform.position = spawner2.position;
        spawner2 = BrickManager.Instance.userMap.GetSpawner(Brick.SPAWNER_TYPE.BLUE_FLAG_SPAWNER, 0);
        rbPlanes[1].transform.position = spawner2.position;
        GameObject brickObjectByPos = BrickManager.Instance.GetBrickObjectByPos(FlagObj.transform.position);

        if (null != brickObjectByPos)
        {
            BrickProperty component = brickObjectByPos.GetComponent <BrickProperty>();
            if (null == component)
            {
                Debug.LogError("<FlagObj> get BrickProperty failed..");
                return;
            }
            captureTheFlag = component.Seq;
        }
        bLoaded = true;
    }
    private void InitializeFirstPerson()
    {
        int[] usables = new int[1]
        {
            4
        };
        GameObject gameObject = GameObject.Find("Me");

        if (null == gameObject)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            EquipCoordinator component = gameObject.GetComponent <EquipCoordinator>();
            if (null == component)
            {
                Debug.LogError("Fail to get EquipCoordinator component for Me");
            }
            else
            {
                component.Initialize(usables);
            }
            localController = gameObject.GetComponent <LocalController>();
            if (null == localController)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
            else
            {
                SpawnerDesc spawner = BrickManager.Instance.GetSpawner(Brick.SPAWNER_TYPE.SINGLE_SPAWNER, 0);
                if (spawner != null)
                {
                    localController.Spawn(spawner.position, Rot.ToQuaternion(spawner.rotation));
                }
                else
                {
                    localController.Spawn(BrickManager.Instance.GetRandomSpawnPos(), Rot.ToQuaternion((byte)Random.Range(0, 4)));
                }
            }
        }
    }
示例#10
0
 private void DoSpawn(SpawnerDesc spawner)
 {
     if (null != localController)
     {
         if (changedRespawnTime)
         {
             respawnTimeSecure.Init(resTime);
             changedRespawnTime = false;
         }
         respawnTimeSecure.Reset();
         if (spawner != null)
         {
             localController.Spawn(spawner.position, Rot.ToQuaternion(spawner.rotation));
         }
         else
         {
             localController.Spawn(BrickManager.Instance.GetRandomSpawnPos(), Rot.ToQuaternion((byte)Random.Range(0, 4)));
         }
     }
 }
 public void Load()
 {
     if (BrickManager.Instance.userMap != null)
     {
         VerifyLocalController();
         localController.initTrain();
         SpawnerDesc[] railSpawners = BrickManager.Instance.userMap.GetRailSpawners();
         if (railSpawners != null)
         {
             for (int i = 0; i < railSpawners.Length; i++)
             {
                 TrainController trainController = new TrainController();
                 trainController.shooter = -1;
                 trainController.seq     = railSpawners[i].sequence;
                 trainController.setInit(railSpawners[i].position, Rot.ToQuaternion(railSpawners[i].rotation));
                 trainController.train = (Object.Instantiate((Object)Instance.objTrain, railSpawners[i].position, Rot.ToQuaternion(railSpawners[i].rotation)) as GameObject);
                 trainObj.Add(trainController);
             }
         }
     }
 }
示例#12
0
    private void OnLoadComplete()
    {
        TrainManager.Instance.Load();
        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_BATTLE_GUIDE))
        {
            BattleGuideDialog battleGuideDialog = (BattleGuideDialog)DialogManager.Instance.GetDialogAlways(DialogManager.DIALOG_INDEX.BATTLE_GUIDE);
            if (battleGuideDialog != null && !battleGuideDialog.DontShowThisMessageAgain)
            {
                ((BattleGuideDialog)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.BATTLE_GUIDE, exclusive: false))?.InitDialog();
            }
        }
    }
示例#13
0
 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 ShowTarget(bool show)
 {
     if (!(null == target))
     {
         if (show)
         {
             BrickInst hitBrickInst = BrickManager.Instance.GetHitBrickInst(hitBrick.transform.gameObject, hitBrick.normal, hitBrick.point);
             if (hitBrickInst == null)
             {
                 show = false;
             }
             else
             {
                 Vector3     vector           = new Vector3((float)(int)hitBrickInst.PosX, (float)(int)hitBrickInst.PosY, (float)(int)hitBrickInst.PosZ);
                 GameObject  brickObjectByPos = BrickManager.Instance.GetBrickObjectByPos(vector);
                 BoxCollider boxCollider      = null;
                 if (brickObjectByPos != null)
                 {
                     boxCollider = brickObjectByPos.GetComponent <BoxCollider>();
                 }
                 if (null != boxCollider)
                 {
                     target.GetComponent <ComposerTarget>().CenterAndSize(boxCollider.center, boxCollider.size);
                     target.transform.position = vector;
                     target.transform.rotation = Rot.ToQuaternion(hitBrickInst.Rot);
                 }
                 else
                 {
                     target.GetComponent <ComposerTarget>().CenterAndSize(new Vector3(0f, 0f, 0f), new Vector3(1f, 1f, 1f));
                     target.transform.position = vector;
                     target.transform.rotation = Quaternion.Euler(0f, 0f, 0f);
                 }
             }
         }
         target.GetComponent <ComposerTarget>().ShowTarget(show);
     }
 }
示例#15
0
    private void OnLoadComplete()
    {
        TrainManager.Instance.Load();
        SpawnerDesc spawner = BrickManager.Instance.GetSpawner((MyInfoManager.Instance.Slot < 4) ? Brick.SPAWNER_TYPE.RED_TEAM_SPAWNER : Brick.SPAWNER_TYPE.BLUE_TEAM_SPAWNER, MyInfoManager.Instance.Ticket);

        if (spawner != null)
        {
            localController.Spawn(spawner.position, Rot.ToQuaternion(spawner.rotation));
        }
        else
        {
            Debug.LogError("Fail to get spawner ");
            localController.Spawn(BrickManager.Instance.GetRandomSpawnPos(), Rot.ToQuaternion((byte)UnityEngine.Random.Range(0, 4)));
        }
        if (!MyInfoManager.Instance.GetCommonMask(MyInfoManager.COMMON_OPT.DONOT_DEFENSE_GUIDE))
        {
            DefenseGuideDialog defenseGuideDialog = (DefenseGuideDialog)DialogManager.Instance.GetDialogAlways(DialogManager.DIALOG_INDEX.DEFENSE_GUIDE);
            if (defenseGuideDialog != null && !defenseGuideDialog.DontShowThisMessageAgain)
            {
                ((DefenseGuideDialog)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.DEFENSE_GUIDE, exclusive: false))?.InitDialog();
            }
        }
        bLoaded = true;
    }
    private void CreateAwardees()
    {
        BrickManManager.Instance.ClearBrickManEtc();
        Brick.SPAWNER_TYPE spawnerType  = Brick.SPAWNER_TYPE.BLUE_TEAM_SPAWNER;
        Brick.SPAWNER_TYPE spawnerType2 = Brick.SPAWNER_TYPE.RED_TEAM_SPAWNER;
        if (cvtEndCode == 1)
        {
            spawnerType  = Brick.SPAWNER_TYPE.RED_TEAM_SPAWNER;
            spawnerType2 = Brick.SPAWNER_TYPE.BLUE_TEAM_SPAWNER;
        }
        int num = 0;

        for (int i = 0; i < RoomManager.Instance.RU.Length; i++)
        {
            if (!RoomManager.Instance.RU[i].red)
            {
                BrickManDesc brickManDesc = BrickManManager.Instance.GetDesc(RoomManager.Instance.RU[i].seq);
                if (brickManDesc == null && RoomManager.Instance.RU[i].seq == MyInfoManager.Instance.Seq)
                {
                    brickManDesc = new BrickManDesc(MyInfoManager.Instance.Seq, MyInfoManager.Instance.Nickname, MyInfoManager.Instance.GetUsings(), 0, MyInfoManager.Instance.Xp, MyInfoManager.Instance.ClanSeq, MyInfoManager.Instance.ClanName, MyInfoManager.Instance.ClanMark, MyInfoManager.Instance.Rank, null, null);
                }
                if (brickManDesc != null)
                {
                    GameObject gameObject = BrickManManager.Instance.AddBrickMan(brickManDesc);
                    if (null != gameObject)
                    {
                        SpawnerDesc awardSpawner4TeamMatch = BrickManager.Instance.GetAwardSpawner4TeamMatch(spawnerType, num++);
                        if (awardSpawner4TeamMatch != null)
                        {
                            gameObject.transform.position = new Vector3(awardSpawner4TeamMatch.position.x, awardSpawner4TeamMatch.position.y - 0.5f, awardSpawner4TeamMatch.position.z);
                            gameObject.transform.rotation = Rot.ToQuaternion(awardSpawner4TeamMatch.rotation);
                        }
                    }
                }
            }
        }
        num = 0;
        for (int j = 0; j < RoomManager.Instance.RU.Length; j++)
        {
            if (RoomManager.Instance.RU[j].red)
            {
                BrickManDesc brickManDesc2 = BrickManManager.Instance.GetDesc(RoomManager.Instance.RU[j].seq);
                if (brickManDesc2 == null && RoomManager.Instance.RU[j].seq == MyInfoManager.Instance.Seq)
                {
                    brickManDesc2 = new BrickManDesc(MyInfoManager.Instance.Seq, MyInfoManager.Instance.Nickname, MyInfoManager.Instance.GetUsings(), 0, MyInfoManager.Instance.Xp, MyInfoManager.Instance.ClanSeq, MyInfoManager.Instance.ClanName, MyInfoManager.Instance.ClanMark, MyInfoManager.Instance.Rank, null, null);
                }
                if (brickManDesc2 != null)
                {
                    GameObject gameObject2 = BrickManManager.Instance.AddBrickMan(brickManDesc2);
                    if (null != gameObject2)
                    {
                        SpawnerDesc awardSpawner4TeamMatch2 = BrickManager.Instance.GetAwardSpawner4TeamMatch(spawnerType2, num++);
                        if (awardSpawner4TeamMatch2 != null)
                        {
                            gameObject2.transform.position = new Vector3(awardSpawner4TeamMatch2.position.x, awardSpawner4TeamMatch2.position.y - 0.5f, awardSpawner4TeamMatch2.position.z);
                            gameObject2.transform.rotation = Rot.ToQuaternion(awardSpawner4TeamMatch2.rotation);
                        }
                    }
                }
            }
        }
    }
    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();
            }
        }
    }
示例#18
0
 public GameObject Instantiate(ushort code, Vector3 position, byte rot)
 {
     return(Instantiate(code, position, Rot.ToQuaternion(rot)));
 }