void Awake() { FieldObjectEntityFactory.init(prefabs); FieldObjectService.init(); /* * Observable.Zip( * //MessageBroker.Default.Receive<CreatedEffectiveFloor>(), * //MessageBroker.Default.Receive<CreatedGameStageRank>(), * //MessageBroker.Default.Receive<CreatedEquipBaseResouces>(), * //MessageBroker.Default.Receive<CreatedFieldObject>(), * MessageBroker.Default.Receive<CreatedPlayerService>(), * //MessageBroker.Default.Receive<LogInitialized>(), * Tuple.Create * ).Subscribe(x => { * //LogService.write("FieldObjectManager::Awake()::Receive<6>"); * //FieldObjectService.init(x.Item5.player_service); * FieldObjectService.createRandomEntities(); * * MessageBroker.Default.Publish<CreatedFieldObject>(new CreatedFieldObject()); * }); */ //FieldObjectService.reset(); MessageBroker.Default.Receive <CreatedEffectiveFloor>().Subscribe(x => { Debug.Log("MessageBroker.Default.Receive<CreatedPlayerService>().Subscribe()"); //FieldObjectService.createRandomEntities(); FieldObjectService.reset(); MessageBroker.Default.Publish <CreatedFieldObject>(new CreatedFieldObject()); }); }
public void OnCollisionEnter(Collision target) { if (target.gameObject == null || target.gameObject.tag != "Player") { return; } if (open.activeSelf) { return; } open.SetActive(true); close.SetActive(false); FieldObjectService.OnCollisionEnter(id, gameObject); MessageBroker.Default.Publish <PlaySe>(new PlaySe { name = "ChestOpen" }); }