예제 #1
0
    public override void initializeMap(GameRoot game_root)
    {
        MapCreator   map_creator   = MapCreator.get();
        PartyControl party_control = PartyControl.get();

        map_creator.setRoomNum(1, 1);

        map_creator.floor_root_go = new GameObject("Floor");

        // 방 만들기.
        RoomController room = map_creator.createRoomFloor(new Map.RoomIndex(0, 0));

        // 더미 방 만들기.
        map_creator.createVacancy(new Map.RoomIndex(0, -1));

        // 방을 구분하는 벽을 만든다.
        map_creator.createRoomWall();

        // 외벽을 만든다.
        map_creator.createOuterWalls();

        GameRoot.get().createLocalPlayer();
        GameRoot.get().createNetPlayers();

        // 플레이어 위치 설정.

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

        Vector3 playerStartPosition = Vector3.zero;

        local_player.transform.position = playerStartPosition + PartyControl.get().getPositionOffset(local_player.control.global_index);

        for (int i = 0; i < PartyControl.get().getFriendCount(); i++)
        {
            chrBehaviorPlayer friend = PartyControl.get().getFriend(i);

            friend.control.cmdSetPositionAnon(playerStartPosition + PartyControl.get().getPositionOffset(friend.control.global_index));
        }

        party_control.setCurrentRoom(room);

        // ボスの作成.

        chrControllerEnemyBase enemy;

        if (UsesHumanControlForBoss)
        {
            enemy = CharacterRoot.get().createEnemy("Boss1", "chrControllerEnemyBoss", "chrBehaviorEnemyBoss_Human") as chrControllerEnemyBase;
        }
        else
        {
            enemy = CharacterRoot.get().createEnemy("Boss1", "chrControllerEnemyBoss", "chrBehaviorEnemyBoss") as chrControllerEnemyBase;
        }

        enemy.cmdSetPosition(new Vector3(0.0f, 0.0f, 20.0f));

        // 스테이터스 창.

        Navi.get().createStatusWindows();
    }
예제 #2
0
    public override void initializeMap(GameRoot game_root)
    {
        MapCreator   map_creator   = MapCreator.get();
        PartyControl party_control = PartyControl.get();

        map_creator.setRoomNum(1, 1);

        // Floor 루트 생성.
        map_creator.floor_root_go = new GameObject("Floor");

        // 무기 선택 플로어에서는 방의 블록을 3 x 4로 변경.
        map_creator.setRoomGridNum(3, 4);

        // 방 만들기.
        RoomController room = map_creator.createRoomFloor(new Map.RoomIndex(0, 0));

        // 더미 방 만들기.
        RoomController vacancy = map_creator.createVacancy(new Map.RoomIndex(0, -1));

        // 방 구분 벽 만들기.
        map_creator.createRoomWall();

        // 외벽 만들기.
        GameObject outer_walls = map_creator.createOuterWalls();

        // 플로어 이동 도어를 하나만 만든다.
        map_creator.createFloorDoor(new Map.RoomIndex(0, 0), new Map.BlockIndex(1, 3), Map.EWSN.NORTH);

        // ---------------------------------------------------------------- //

        Renderer[] renderers = outer_walls.GetComponentsInChildren <Renderer>();

        foreach (var render in renderers)
        {
            render.material.shader = this.map_shader;
        }

        //

        renderers = vacancy.GetComponentsInChildren <Renderer>();

        foreach (var render in renderers)
        {
            render.material.shader = this.map_shader;
        }

        renderers = room.GetComponentsInChildren <Renderer>();

        foreach (var render in renderers)
        {
            render.material.shader = this.map_shader;
        }

        // ---------------------------------------------------------------- //
        // 무 아저씨.

        chrController kabusan = CharacterRoot.get().createNPC("NPC_Kabu_San");

        kabusan.cmdSetPositionAnon(chrBehaviorKabu.getStayPosition());
        kabusan.cmdSetDirectionAnon(chrBehaviorKabu.getStayDirection());

        // ---------------------------------------------------------------- //
        // 로컬 플레이어.

        party_control.createLocalPlayer(GlobalParam.getInstance().global_account_id);

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

        player.control.cmdSetPositionAnon(new Vector3(0.0f, 0.0f, -9.0f));
        player.changeBulletShooter(SHOT_TYPE.EMPTY);

        // ---------------------------------------------------------------- //
        // 아이템 생성.

        this.generateItems(game_root);

        party_control.setCurrentRoom(room);

        ItemWindow.get().setActive(false);
    }