Пример #1
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();
            }
        }
    }
Пример #2
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;
    }
Пример #3
0
    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)));
                }
            }
        }
    }
Пример #4
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)));
         }
     }
 }
Пример #5
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();
            }
        }
    }
Пример #6
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();
         }
     }
 }
Пример #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();
     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();
         }
     }
 }
Пример #9
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;
    }
Пример #10
0
    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();
            }
        }
    }