public IStreetItemController GetControllerFor(TrashView view) { if (trashes.ContainsKey(view)) { var result = trashes[view]; result.Position = view.transform.position; //TODO hacky :( return(result); } return(null); }
public void Spawn(TrashView trash, PartData partData) { var gameObject = Instantiate(config.Template, transform); gameObject.transform.position = trash.transform.position; var partView = gameObject.GetComponent <PartView>(); partView.TargetTransform = inventoryButton; partView.DrawOrder = trash.DrawOrder + 9; partView.Spawn(partData); partView.OnCollected += HandlePartCollected; parts[partView] = partData; }
private void HandleTrashViewHit(TrashView trashView, PartData partData) { partMediator.Spawn(trashView, partData); collectionController.Spawn(); }