Exemplo n.º 1
0
    // 레벨 시작 시에 호출.
    public override void            start()
    {
        // 각 플레이어가 케이크를 획득한 수..

        this.cake_counts = new int[NetConfig.PLAYER_MAX];

        for (int i = 0; i < this.cake_counts.Length; i++)
        {
            if (GameRoot.get().isConnected(i))
            {
                this.cake_counts[i] = -1;
            }
            else
            {
                this.cake_counts[i] = 0;
            }
        }

        chrBehaviorLocal local_player = PartyControl.get().getLocalPlayer();

        this.cake_counts[local_player.getGlobalIndex()] = local_player.getCakeCount();

        QueryCakeCount query_cake = new QueryCakeCount(local_player.getAcountID(), local_player.getCakeCount());

        query_cake.timeout = 20.0f;

        QueryManager.get().registerQuery(query_cake);

        // Network 클래스의 컴포넌트 획득.
        GameObject obj = GameObject.Find("Network");

        if (obj != null)
        {
            this.m_network = obj.GetComponent <Network>();

            if (this.m_network != null)
            {
                this.m_network.RegisterReceiveNotification(PacketId.PrizeResult, OnReceivePrizeResultPacket);
            }
        }

        // 케이크 데이터 송신.
        sendPrizeData();

        this.step.set_next(STEP.WAIT_FRIEND);
    }