Ejemplo n.º 1
0
    private void RecalculateHousePoints()
    {
        points = 0;

        for (int i = 0; i < items_around.Count; ++i)
        {
            Item curr_item = items_around[i];

            points += curr_item.GetPointsToGive();
        }

        EventSetScore ev = new EventSetScore(player_instance, points);

        EventManager.Instance.SendEvent(ev);
    }
Ejemplo n.º 2
0
    public void OnEvent(GameEvent ev)
    {
        switch (ev.Type())
        {
        case GameEventType.EVENT_SET_SCORE:
        {
            EventSetScore add_score = (EventSetScore)ev;

            if (add_score.player != player)
            {
                break;
            }

            score.SetScore(add_score.amount);

            break;
        }

        default:
            Debug.LogError("UIPlayer: Invalid call to OnEvent");
            break;
        }
    }
Ejemplo n.º 3
0
    private void Start()
    {
        EventSetScore ev = new EventSetScore(player_instance, points);

        EventManager.Instance.SendEvent(ev);
    }