Exemplo n.º 1
0
 public Boss_1_Turn(BattleTurnsModule btm) : base(btm)
 {
     _bfm = ModuleManager.getInstance.GetModule <BattlefieldModule>();
     _bui = ModuleManager.getInstance.GetModule <BattleUIModule>();
     _rmm = ModuleManager.getInstance.GetModule <RobotManagerModule>();
     _bim = ModuleManager.getInstance.GetModule <BattlefieldInputModule>();
 }
Exemplo n.º 2
0
        public override void OnDestroy()
        {
            _turnmodule = ModuleManager.getInstance.GetModule <BattleTurnsModule>();
            _turnmodule.Notifications -= OnNextTurn;

            base.OnDestroy();
        }
Exemplo n.º 3
0
        public Boss_2_Turn(BattleTurnsModule btm) : base(btm)
        {
            _bfm = ModuleManager.getInstance.GetModule <BattlefieldModule>();
            _bui = ModuleManager.getInstance.GetModule <BattleUIModule>();
            _rmm = ModuleManager.getInstance.GetModule <RobotManagerModule>();
            _bim = ModuleManager.getInstance.GetModule <BattlefieldInputModule>();
            //创建自己body
            var boss_object = GameObject.Instantiate(Resources.Load("Prefabs/Boss/boss_2_body")) as GameObject;
            var wp          = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width / 2, 0, 1));

            boss_object.transform.position = wp;
            boss_object.gameObject.SetActive(false);
            boss_body = boss_object.GetComponent <Boss_2_Body>();
        }
Exemplo n.º 4
0
        IEnumerator LoadBattleScene(int level, int area)
        {
            yield return(0);

            var back = SceneManager.LoadSceneAsync("Battlefield");

            while (!back.isDone)
            {
                yield return(0);
            }

            _battleLogicObject.onupdate += Update;
            //-----------------

            //-----------------
            //
            _battleModule = ModuleManager.getInstance.GetModule <BattlefieldModule>();
            _battleModule.SelectLevel(area, level);

            ModuleManager.getInstance.StartModule <BattlefieldCameraModule>();
            ModuleManager.getInstance.StartModule <BattlefieldInputModule>();
            //UI mode 启动前置!
            ModuleManager.getInstance.StartModule <BattleUIModule>();
            ModuleManager.getInstance.StartModule <BattleTurnsModule>();
            ModuleManager.getInstance.StartModule <ShopUIModule>();

            //masktile管理
            ModuleManager.getInstance.StartModule <MaskTileModule>();

            //此处载入关卡数据mapdata
            ModuleManager.getInstance.StartModule <BattlefieldModule>();
            ModuleManager.getInstance.StartModule <RobotManagerModule>();
            ModuleManager.getInstance.StartModule <StarredModule>();

            _battleUIModule     = ModuleManager.getInstance.GetModule <BattleUIModule>();
            _battleInputModule  = ModuleManager.getInstance.GetModule <BattlefieldInputModule>();
            _robotManagerModule = ModuleManager.getInstance.GetModule <RobotManagerModule>();
            _battleTurnsModule  = ModuleManager.getInstance.GetModule <BattleTurnsModule>();
            _shopUIModule       = ModuleManager.getInstance.GetModule <ShopUIModule>();
            _controllerModule   = ModuleManager.getInstance.GetModule <BattleControllerModule>();
            _starredModule      = ModuleManager.getInstance.GetModule <StarredModule>();
            //这里尝试载入一下道具
            SaveLoader.getInstance.LoadPlayerCurItems(area);

            //加上mission回调
            MissionManager.getInstance.OnMissionValueHandler += OnMissionValue;

            _battleTurnsModule.NextTurn();
        }
Exemplo n.º 5
0
        public override void Init(string additionalData)
        {
            base.Init(additionalData);


            _turnmodule = ModuleManager.getInstance.GetModule <BattleTurnsModule>();
            _turnmodule.Notifications += OnNextTurn;

            var emitterObj = Node.transform.Find("laser_cube/emitter");

            _laserEmitter = emitterObj.GetComponent <LaserEmitter>();

            if (_laserEmitter == null)
            {
                _laserEmitter = emitterObj.gameObject.AddComponent <LaserEmitter>();
            }

            _laserEmitter.AddBlockTileType(typeof(BlockTile));
            _laserEmitter.AddBlockTileType(typeof(LockTile));
            _laserEmitter.AddBlockTileType(typeof(GemTile));
            _laserEmitter.AddBlockTileType(typeof(BombTile));

            _laserEmitter.AddBlockTileType(typeof(LaserTile));
            _laserEmitter.AddBlockTileType(typeof(DiskTile));

            _laserEmitter.AddBlockTileType(typeof(UpDirectTile));
            _laserEmitter.AddBlockTileType(typeof(DownDirectTile));
            _laserEmitter.AddBlockTileType(typeof(LeftDirectTile));
            _laserEmitter.AddBlockTileType(typeof(RightDirectTile));

            switch (additionalData)
            {
            case "up":
            {
                _dir = new Vector2Int(0, -1);
                _laserEmitter.transform.localEulerAngles = new Vector3(0, 0, 0);
            }
            break;

            case "down":
            {
                _dir = new Vector2Int(0, 1);
                _laserEmitter.transform.localEulerAngles = new Vector3(0, 0, 180);
            }
            break;

            case "left":
            {
                _dir = new Vector2Int(-1, 0);
                _laserEmitter.transform.localEulerAngles = new Vector3(0, 0, 90);
            }
            break;

            case "right":
            {
                _dir = new Vector2Int(1, 0);
                _laserEmitter.transform.localEulerAngles = new Vector3(0, 0, -90);
            }
            break;
            }
        }
Exemplo n.º 6
0
 public RobotTurn(BattleTurnsModule btm) : base(btm)
 {
     _robotManagerModule = ModuleManager.getInstance.GetModule <RobotManagerModule>();
 }
Exemplo n.º 7
0
 public PlayerTurn(BattleTurnsModule btm) : base(btm)
 {
     _battleFieldInputModule = ModuleManager.getInstance.GetModule <BattlefieldInputModule>();
 }
Exemplo n.º 8
0
 public CTurn(BattleTurnsModule btm)
 {
     _battleTurnsModule = btm;
 }
Exemplo n.º 9
0
 public StarredTurn(BattleTurnsModule btm) : base(btm)
 {
     Components = new List <StarredComponent>();
 }