예제 #1
0
 public void Initialize(UserModel model, int guid)
 {
     //絶対にnewしないと参照が変になる。
     status = new UserModel(model)
     {
         guid = guid, isAction = false
     };
     characterView.Initialize();
     DummyItem();
 }
예제 #2
0
    private void Awake()
    {
        // Master
        MasterView viewMaster = Instantiate(masterView);

        viewMaster.Initialize(gameSetting.masterSetting);
        Master          master        = new Master(viewMaster);
        MasterAIControl masterControl = new MasterAIControl(master);

        // AI
        List <AIControl> AIControlList = new List <AIControl>();
        List <Character> AICharacter   = new List <Character>();

        for (int i = 0; i < AINumber; ++i)
        {
            CharacterView view = Instantiate(characterPrefab);
            view.Initialize(gameSetting.characterSetting);
            Character character = new Character(view);
            AIControl aiControl = new AIControl(gameSetting.AIControlSetting, character, master);
            AIControlList.Add(aiControl);
            AICharacter.Add(character);
        }

        // Player
        CharacterView playerView = Instantiate(characterPrefab);

        playerView.Initialize(gameSetting.characterSetting);
        Character     player        = new Character(playerView);
        PlayerControl playerControl = new PlayerControl(player, AICharacter);

        GameTime gameTime = new GameTime();

        controllerManager = new ControllerManager(playerControl, AIControlList, masterControl);
        gameManager       = new GameManager(gameTime, controllerManager, player, AICharacter, master);

        successPanel.SetGameTime(gameTime);
    }