public Component.ItemComponent CreateItem(Entity.ItemEntity entity, Vector3 barthPosition) { var itemComponent = _itemCreaterView.CreateItem(entity, barthPosition); _itemCreaterModel.AddFieldItem(itemComponent); return(itemComponent); }
public void Init(ScoreModel scoreModel) { _itemCreaterModel = new ItemCreaterModel(new Entity.ItemListEntity(_itemListData)); _itemCreaterView.Init(); _scoreModel = scoreModel; NormalScoreItem = _itemCreaterModel.NormalScoreItem; Bind(); }
public Component.ItemComponent CreateItem(Entity.ItemEntity itemEntity, Vector3 barthPosition) { var item = Instantiate(itemEntity.Component, barthPosition, Quaternion.identity); item.Init(itemEntity); item.OnGetItem.Subscribe(e => { e.FXCreateEntity = new Entity.FXCreateEntity(e.GetPosition, Enum.FXType.Item, e.ItemColor); _onGetItem.OnNext(e); }); return(item); }
public ItemComponent CreateItem(Entity.ItemEntity itemEntity, Vector3 position) { var item = Instantiate(itemEntity.Component, position, Quaternion.identity); item.Init(itemEntity); item.OnGetItem.Subscribe(e => { _normalFieldItems.Remove(item); _specialItemCreater.SendTrigger(ItemCreaterMessage.REDUCE_SPECIAL_ITEM_INTERVAL); e.FXCreateEntity = new Entity.FXCreateEntity(e.GetPosition, Enum.FXType.Item, e.ItemColor); _scoreModel.AddScore = e.Score; _onGetItem.OnNext(e); }); return(item); }