Esempio n. 1
0
        public void MockStartBattle()
        {
            _datastore.inputEvents.Receive <KeyEvent>()
            .Where(e => e.keyCode == KeyCode.N)
            .Subscribe(_ => {
                switch (_datastore.activeTeam.Count)
                {
                case 0:
                    var charmander = new Mon {
                        name     = "Ash",
                        prefab   = _prefabs.charmander,
                        instance = Instantiate(
                            _prefabs.charmander,
                            spawnArea.transform.position,
                            Quaternion.identity)
                    };
                    _datastore.activeTeam.Add(charmander);
                    _datastore.leftFormation.AddToFormation(charmander);
                    break;

                case 1:
                    var beldum = new Mon {
                        name     = "Rivet",
                        prefab   = _prefabs.beldum,
                        instance = Instantiate(
                            _prefabs.beldum,
                            spawnArea.transform.position,
                            Quaternion.identity)
                    };
                    _datastore.activeTeam.Add(beldum);
                    _datastore.leftFormation.AddToFormation(beldum);
                    break;

                case 2:
                    var shinx = new Mon {
                        name     = "Bolt",
                        prefab   = _prefabs.shinx,
                        instance = Instantiate(
                            _prefabs.shinx,
                            spawnArea.transform.position,
                            Quaternion.identity)
                    };
                    _datastore.activeTeam.Add(shinx);
                    _datastore.leftFormation.AddToFormation(shinx);
                    break;

                case 3:
                    var sewaddle = new Mon {
                        name     = "Gucci",
                        prefab   = _prefabs.sewaddle,
                        instance = Instantiate(
                            _prefabs.sewaddle,
                            spawnArea.transform.position,
                            Quaternion.identity)
                    };
                    _datastore.activeTeam.Add(sewaddle);
                    _datastore.leftFormation.AddToFormation(sewaddle);
                    break;

                case 4:
                    var tympole = new Mon {
                        name     = "Greg",
                        prefab   = _prefabs.tympole,
                        instance = Instantiate(
                            _prefabs.tympole,
                            spawnArea.transform.position,
                            Quaternion.identity)
                    };
                    _datastore.activeTeam.Add(tympole);
                    _datastore.leftFormation.AddToFormation(tympole);
                    break;
                }
                UpdateMonPositions();
            });
        }