Exemple #1
0
        public IStreetItemController GetControllerFor(TrashView view)
        {
            if (trashes.ContainsKey(view))
            {
                var result = trashes[view];
                result.Position = view.transform.position; //TODO hacky :(

                return(result);
            }
            return(null);
        }
Exemple #2
0
        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;
        }
Exemple #3
0
 private void HandleTrashViewHit(TrashView trashView, PartData partData)
 {
     partMediator.Spawn(trashView, partData);
     collectionController.Spawn();
 }