public override void Execute() { string viewName = (string)evt.data; ICollectableModel collectableModel = injectionBinder.GetBinding(viewName).value as ICollectableModel; dispatcher.Dispatch(collectableModel.collEvent, viewName); }
public override void Execute() { TextAsset file = Resources.Load("Collectables") as TextAsset; var n = SimpleJSON.JSON.Parse(file.text); for (int i = 0; i < n.Count; i++) { ICollectableModel collectableModel = injectionBinder.GetInstance <ICollectableModel>(); string collectableName = n [i]["name"].Value; float posX = n [i] ["posX"].AsFloat; float posY = n [i] ["posY"].AsFloat; float posZ = n [i] ["posZ"].AsFloat; collectableModel.collEvent = n [i] ["event"]; GameObject goColl = GameObject.Instantiate(Resources.Load(PrefabNames.COLLECTABLE_PREFAB)) as GameObject; goColl.name = collectableName; goColl.AddComponent <CollectableView> (); goColl.transform.position = new Vector3(posX, posY, posZ); goColl.tag = "Collectable"; goColl.transform.parent = contextView.transform; injectionBinder.Bind(collectableName).To(collectableModel); } }
public override void Execute() { string viewName = (string)evt.data; ICollectableModel collectableModel = injectionBinder.GetBinding(viewName).value as ICollectableModel; collectableModel.setSpeedPenalty(); enemy.setEnemySpeed(); speedPenalty = enemy.speed - collectableModel.speedPenalty; dispatcher.Dispatch(GameEvents.ON_ENEMY_SPEED_DECREASED, speedPenalty); }
public override void Execute() { string viewName = (string)evt.data; ICollectableModel collectableModel = injectionBinder.GetBinding(viewName).value as ICollectableModel; myWeapon.setWeaponPower(); collectableModel.setPowerBonus(); powerIncreased = myWeapon.weaponPower + collectableModel.powerBonus; dispatcher.Dispatch(GameEvents.ON_POWER_BONUS_ADDED, powerIncreased); }
public override void Execute() { string viewName = (string)evt.data; ICollectableModel collectableModel = injectionBinder.GetBinding(viewName).value as ICollectableModel; collectableModel.setSpeedBonus(); myPlayer.setSpeed(); speedIncreased = myPlayer.speed + collectableModel.speedBonus; dispatcher.Dispatch(GameEvents.ON_SPEED_BONUS_ADDED, speedIncreased); }