コード例 #1
0
 void addCameraSnapPositionIfNotExist(LevelModelComponent component, Entity cameraEntity)
 {
     if (!cameraEntity.hasSnapPosition)
     {
         cameraEntity.AddSnapPosition(component.position.x, component.position.y, component.size.x, component.size.y, false);
     }
 }
コード例 #2
0
 public Entity ReplaceEnemySpawner(LevelModelComponent newModel)
 {
     var component = CreateComponent<EnemySpawnerComponent>(ComponentIds.EnemySpawner);
     component.model = newModel;
     ReplaceComponent(ComponentIds.EnemySpawner, component);
     return this;
 }
コード例 #3
0
 public void SetData(LevelModelComponent component)
 {
     this.component = component;
     attachScripts();
     createModifiers(component);
     fillViewByComponent(component);
     createHud();
 }
コード例 #4
0
 public RightLevelSliderHud(Transform transform, Pool pool, LevelModelComponent component)
 {
     go = transform.gameObject;
     this.pool = pool;
     this.component = component;
     camera = Camera.main;
     addOnValueChangeListener();
     addSliderAutoUpdate();
 }
コード例 #5
0
 public void Execute(LevelModelComponent component)
 {
     component.waves.Sort((first, second) => first.spawnBarrier.CompareTo(second.spawnBarrier));
     component.enemies.Sort((first, second) => first.spawnBarrier.CompareTo(second.spawnBarrier));
 }
コード例 #6
0
 void fillViewByComponent(LevelModelComponent component)
 {
     foreach (WaveSpawnModel model in component.waves) {
         factory.CreateWaveElement(model);
     }
     foreach (EnemySpawnModel model in component.enemies) {
         factory.CreateEnemyElement(model);
     }
     factory.refreshNumeration();
 }
コード例 #7
0
 void createModifiers(LevelModelComponent component)
 {
     executor = new LevelActionExecutor(component);
     factory = new EditableElementsFactory(pool.GetGroup(Matcher.MaterialReference).GetSingleEntity().materialReference.storage.Default);
     createViewModifier();
 }
コード例 #8
0
 public void Execute(LevelModelComponent component)
 {
     component.position.x = x;
     component.position.y = y;
 }
コード例 #9
0
 public Entity AddEnemySpawner(LevelModelComponent newModel)
 {
     var component = CreateComponent<EnemySpawnerComponent>(ComponentIds.EnemySpawner);
     component.model = newModel;
     return AddComponent(ComponentIds.EnemySpawner, component);
 }
コード例 #10
0
 public void Execute(LevelModelComponent component)
 {
     model = createEnemyModel();
     component.enemies.Add(model);
 }
コード例 #11
0
 public LevelActionExecutor(LevelModelComponent component)
 {
     this.component = component;
 }
コード例 #12
0
ファイル: UpdateLevel.cs プロジェクト: kicholen/SpaceShooter
 public UpdateLevel(LevelModelComponent component)
 {
     urlData.Add("levels");
     urlData.Add("update");
     postData.Add("data", JsonConvert.SerializeObject(component, Formatting.None, new JsonConverter[] { new Vector2Converter() }));
 }
コード例 #13
0
 public void Execute(LevelModelComponent component)
 {
     component.name = name;
 }
コード例 #14
0
ファイル: CreateLevel.cs プロジェクト: kicholen/SpaceShooter
 public override void ParseResult()
 {
     Component = JsonConvert.DeserializeObject<LevelModelComponent>(result);
 }
コード例 #15
0
ファイル: LevelService.cs プロジェクト: kicholen/SpaceShooter
 public void UpdateLevel(LevelModelComponent component, Action onLevelUpdated)
 {
     wwwService.Send<UpdateLevel>(new UpdateLevel(component), (request) => onLevelUpdated(), onRequestFailed);
 }
コード例 #16
0
 public void Execute(LevelModelComponent component)
 {
     component.enemies.Remove(model);
 }
コード例 #17
0
 public void Execute(LevelModelComponent component)
 {
     model = createWaveModel();
     component.waves.Add(model);
 }