コード例 #1
0
    public static void Subscribe(Consts.Events.events gameEvent, Action method)
    {
        if (gameEvent == Consts.Events.events.jump)
        {
            jump += method;
        }

        if (gameEvent == Consts.Events.events.startGame)
        {
            startGame += method;
        }

        if (gameEvent == Consts.Events.events.startLeftStick)
        {
            startLeftStick += method;
        }

        if (gameEvent == Consts.Events.events.startRightStick)
        {
            startRightStick += method;
        }

        if (gameEvent == Consts.Events.events.lose)
        {
            Lose += method;
        }


        if (gameEvent == Consts.Events.events.letDown)
        {
            letDown += method;
        }


        if (gameEvent == Consts.Events.events.replay)
        {
            replay += method;
        }
    }
コード例 #2
0
    public static void InvokeEvent(Consts.Events.events eventParametr)
    {
        if (eventParametr == Consts.Events.events.jump)
        {
            jump();
        }

        if (eventParametr == Consts.Events.events.startGame)
        {
            startGame();
        }

        if (eventParametr == Consts.Events.events.startLeftStick)
        {
            startLeftStick();
        }

        if (eventParametr == Consts.Events.events.startRightStick)
        {
            startRightStick();
        }

        if (eventParametr == Consts.Events.events.lose)
        {
            Lose();
        }

        if (eventParametr == Consts.Events.events.letDown)
        {
            letDown();
        }

        if (eventParametr == Consts.Events.events.replay)
        {
            replay();
        }
    }
コード例 #3
0
    //public static event Action pickUpWeapone;


    public static void Subscribe(Consts.Events.events gameEvent, Action method)
    {
        if (gameEvent == Consts.Events.events.fZhitPlayer)
        {
            fZHitPlayer += method;
        }


        if (gameEvent == Consts.Events.events.flashLightTurned)
        {
            flashLightTurned += method;
        }


        if (gameEvent == Consts.Events.events.updateWaveUI)
        {
            updateWaveCounterUI += method;
        }


        if (gameEvent == Consts.Events.events.upgradeWeapon)
        {
            upgradeWeapon += method;
        }

        if (gameEvent == Consts.Events.events.pause)
        {
            pause += method;
        }


        if (gameEvent == Consts.Events.events.sZhitPlayer)
        {
            sZHitPlayer += method;
        }


        if (gameEvent == Consts.Events.events.addScoreForTheFZ)
        {
            addScoreForTheFZ += method;
        }


        if (gameEvent == Consts.Events.events.addScoreForTheSZ)
        {
            addScoreForTheSZ += method;
        }


        if (gameEvent == Consts.Events.events.reduceZombie)
        {
            reduceZombie += method;
        }


        if (gameEvent == Consts.Events.events.spawnWave)
        {
            spawnWave += method;
        }


        if (gameEvent == Consts.Events.events.updateHealth)
        {
            updateHealthBar += method;
        }


        if (gameEvent == Consts.Events.events.startGame)
        {
            startGame += method;
        }



        if (gameEvent == Consts.Events.events.lose)
        {
            lose += method;
        }



        if (gameEvent == Consts.Events.events.replay)
        {
            replay += method;
        }
    }
コード例 #4
0
    public static void InvokeEvent(Consts.Events.events eventParametr)
    {
        if (eventParametr == Consts.Events.events.spawnLoot)
        {
            if (spawnLoot != null)
            {
                spawnLoot();
            }
        }


        //if (eventParametr == Consts.Events.events.pickUpWeapone)
        //{
        //    if (pickUpWeapone != null)
        //        pickUpWeapone();
        //}


        if (eventParametr == Consts.Events.events.pickUpM16)
        {
            if (pickUpM16 != null)
            {
                pickUpM16();
            }
        }


        if (eventParametr == Consts.Events.events.pickUpM14)
        {
            if (pickUpM14 != null)
            {
                pickUpM14();
            }
        }



        if (eventParametr == Consts.Events.events.fZhitPlayer)
        {
            if (fZHitPlayer != null)
            {
                fZHitPlayer();
            }
        }


        if (eventParametr == Consts.Events.events.fillFlashLight)
        {
            if (fillFlashlight != null)
            {
                fillFlashlight();
            }
        }

        if (eventParametr == Consts.Events.events.flashLightTurned)
        {
            flashLightTurned();
        }


        if (eventParametr == Consts.Events.events.upgradeWeapon)
        {
            upgradeWeapon();
        }



        if (eventParametr == Consts.Events.events.updateWaveUI)
        {
            updateWaveCounterUI();
        }


        if (eventParametr == Consts.Events.events.pause)
        {
            pause();
        }


        if (eventParametr == Consts.Events.events.sZhitPlayer)
        {
            sZHitPlayer();
        }

        if (eventParametr == Consts.Events.events.addScoreForTheFZ)
        {
            addScoreForTheFZ();
        }


        if (eventParametr == Consts.Events.events.addScoreForTheSZ)
        {
            addScoreForTheSZ();
        }

        if (eventParametr == Consts.Events.events.reduceZombie)
        {
            reduceZombie();
        }

        if (eventParametr == Consts.Events.events.spawnWave)
        {
            spawnWave();
        }

        if (eventParametr == Consts.Events.events.updateHealth)
        {
            updateHealthBar();
        }


        if (eventParametr == Consts.Events.events.startGame)
        {
            startGame();
        }


        if (eventParametr == Consts.Events.events.lose)
        {
            lose();
        }



        if (eventParametr == Consts.Events.events.replay)
        {
            replay();
        }
    }