Ejemplo n.º 1
0
    public override void Execute()
    {
        string            viewName         = (string)evt.data;
        ICollectableModel collectableModel = injectionBinder.GetBinding(viewName).value as ICollectableModel;

        dispatcher.Dispatch(collectableModel.collEvent, viewName);
    }
Ejemplo n.º 2
0
    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);
        }
    }
Ejemplo n.º 3
0
    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);
    }
Ejemplo n.º 4
0
    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);
    }
Ejemplo n.º 5
0
    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);
    }