Beispiel #1
0
    IEnumerator GetCoinEventList(float time)
    {
        int newInCoin1  = JavaInterface.getInCoin1();
        int newInCoin2  = JavaInterface.getInCoin2();
        int newOutCoin1 = JavaInterface.getOutCoin1();
        int newOutCoin2 = JavaInterface.getOutCoin2();

        int newScorePlayer = JavaInterface.GetScorePlayer();

        int oldInCoin1     = newInCoin1;
        int oldInCoin2     = newInCoin2;
        int oldOutCoin1    = newOutCoin1;
        int oldOutCoin2    = newOutCoin2;
        int oldScorePlayer = newScorePlayer;

        while (true)
        {
            newInCoin1  = JavaInterface.getInCoin1();
            newInCoin2  = JavaInterface.getInCoin2();
            newOutCoin1 = JavaInterface.getOutCoin1();
            newOutCoin2 = JavaInterface.getOutCoin2();

            newScorePlayer = JavaInterface.GetScorePlayer();

            if (newScorePlayer != oldScorePlayer)
            {
                oldScorePlayer = newScorePlayer; OnChangeScoreEvent(newScorePlayer);
            }

            if (newInCoin1 != oldInCoin1)
            {
                oldInCoin1 = newInCoin1; OnChangeInCoin1Event();
            }
            if (newInCoin2 != oldInCoin2)
            {
                oldInCoin2 = newInCoin2; OnChangeInCoin2Event();
            }
            if (newOutCoin1 != oldOutCoin1)
            {
                oldOutCoin1 = newOutCoin1; OnChangeOutCoin1Event();
            }
            if (newOutCoin2 != oldOutCoin2)
            {
                oldOutCoin2 = newOutCoin2; OnChangeOutCoin2Event();
            }
            yield return(new WaitForSeconds(time));
        }
    }