Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        this.user_state  = USER_STATE.NOT_CONNECTED;
        this.bg          = Resources.Load("images/title_blue") as Texture;
        this.battle_room = GameObject.Find("BattleRoom").GetComponent <CBattleRoom>();
        this.battle_room.gameObject.SetActive(false);

        this.network_manager = GameObject.Find("NetworkManager").GetComponent <CNetworkManager>();

        this.user_state = USER_STATE.NOT_CONNECTED;
        enter();
    }
Esempio n. 2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != null)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
     network_manager.messageReceiver = this;
     this.battle_room = GameObject.Find("BattleRoom").GetComponent <CBattleRoom>();
     this.battle_room.gameObject.SetActive(false);
 }
Esempio n. 3
0
    private void Awake()
    {
        Debug.Log("CBattleRoom Awake");
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != null)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);

        this.gameMain       = GameObject.Find("GameMain").GetComponent <GameMain>();
        this.networkManager = GameObject.Find("NetworkManager").GetComponent <CNetworkManager>();
        this.buildManager   = GameObject.Find("BuildManager").GetComponent <BuildManager>();
    }
    void Awake()
    {
        this.room = GetComponent <CBattleRoom>();

        // Make board data.
        // 보드판 데이터를 만든다.
        this.table_board = new List <short>();
        for (int i = 0; i < CBattleRoom.COL_COUNT * CBattleRoom.COL_COUNT; ++i)
        {
            this.table_board.Add((short)i);
        }

        // Enable touches.
        // 터치 활성화.
        gameObject.AddComponent <CMapCollision>();

        // A component to see movable area.
        // 이동 가능한 영역을 보여주기 위한 컴포넌트.
        gameObject.AddComponent <CBorderViewer>();
    }
Esempio n. 5
0
    /// <summary>
    /// 패킷을 수신 했을 때 호출됨.
    /// </summary>
    /// <param name="protocol"></param>
    /// <param name="msg"></param>
    void IMessageReceiver.on_recv(CPacket msg)
    {
        // 제일 먼저 프로토콜 아이디를 꺼내온다.
        PROTOCOL protocol_id = (PROTOCOL)msg.pop_protocol_id();

        switch (protocol_id)
        {
        case PROTOCOL.ENTER_GAME_ROOM_ACK:
        {
            CUIManager.Instance.hide_all();
            CUIManager.Instance.show(UI_PAGE.POPUP_NETWORK_PROCESSING);
            CPopupNetworkProcessing popup =
                CUIManager.Instance.get_uipage(UI_PAGE.POPUP_NETWORK_PROCESSING).GetComponent <CPopupNetworkProcessing>();
            popup.refresh("매칭 대기중");

            CUIManager.Instance.show(UI_PAGE.STATUS_BAR);
            CUIManager.Instance.get_uipage(UI_PAGE.STATUS_BAR).GetComponent <CStatusBar>().refresh(1);
        }
        break;

        case PROTOCOL.START_LOADING:
        {
            CUIManager.Instance.hide_all();
            CUIManager.Instance.show(UI_PAGE.PLAY_ROOM);
            CBattleRoom room =
                CUIManager.Instance.get_uipage(UI_PAGE.PLAY_ROOM).GetComponent <CBattleRoom>();
            room.start_loading();

            CUIManager.Instance.show(UI_PAGE.STATUS_BAR);
        }
        break;

        case PROTOCOL.CONCURRENT_USERS:
        {
            int count = msg.pop_int32();
            CUIManager.Instance.get_uipage(UI_PAGE.STATUS_BAR).GetComponent <CStatusBar>().refresh(count);
        }
        break;
        }
    }
Esempio n. 6
0
 void Awake()
 {
     this.room = GetComponent <CBattleRoom>();
 }