public void AddEnemy(int enemyType) { LevelInitializer.StartAddObjEvent?.Invoke(); routine = Observable .FromCoroutine(() => selector.SelectNodeRoutine("Select node to place enemy")) .Subscribe(_ => { InstanceEnemy(GetEnemyPref(enemyType), selector.Nodes[0].transform.position); selector.Reset(); LevelInitializer.EndAddObjEvent?.Invoke(); }); }
public void AddHightFloor() { LevelInitializer.StartAddObjEvent.Invoke(); routine = Observable .FromCoroutine(() => selector.SelectNodeRoutine("Select node to place building block")) .Subscribe(_ => { PlaceFloor(selector.Nodes[0]); selector.Reset(); LevelInitializer.EndAddObjEvent?.Invoke(); }); }
public void AddBarrier() { LevelInitializer.StartAddObjEvent?.Invoke(); routine = Observable .FromCoroutine(() => selector.SelectNodeRoutine("Select point for lever")) .SelectMany(() => selector.SelectNodeRoutine("Select point 1")) .SelectMany(() => selector.SelectNodeRoutine("Select point 2")) .Subscribe(_ => { CreateBarreir(selector.Nodes[0], selector.Nodes[1], selector.Nodes[2]); selector.Reset(); LevelInitializer.EndAddObjEvent?.Invoke(); }); }
public void PlaceObject(int objectType) { LevelInitializer.StartAddObjEvent.Invoke(); routine = Observable .FromCoroutine(() => selector.SelectNodeRoutine("Select node to place object")) .Subscribe(_ => { PlaceObject((NodeType)objectType, selector.Nodes[0].transform); selector.Reset(); LevelInitializer.EndAddObjEvent?.Invoke(); }); }