Exemple #1
0
    void Start()
    {
        IScriptableObjectLoader scriptableObjectLoader = new ScriptableObjectLoader();
        ISceneTable             sceneTable             = scriptableObjectLoader.LoadScriptableObject(eScriptableObject.SceneTable) as ISceneTable;
        ISceneSystem            sceneSystem            = new SceneSystem(sceneTable);
        IGameSetting            gameSetting            = new GameSetting();
        IUIPrefabTable          uiPrefabTable          = scriptableObjectLoader.LoadScriptableObject(eScriptableObject.UISystemTable) as IUIPrefabTable;
        IUILoader          uiLoader          = new UILoader(uiPrefabTable);
        IUISystem          uiSystem          = new UISystem(uiLoader);
        IGameProcessSystem gameProcessSystem = new GameProcessSystem(gameSetting, sceneSystem, uiSystem);
        IGameMainLoop      gameMainLoop      = new GameMainLoop(gameProcessSystem);

        gameMainLoop.Start();

        DontDestroyOnLoad(this);
    }
Exemple #2
0
    public static void Format(string asset, string exportedFile)
    {
        BGMList bgmList = ScriptableObjectLoader.Initialize <BGMList>(exportedFile);

        bgmList.Params.Clear();
        foreach (List <string> data in CSVParser.ProcessingData <BGMList>(asset))
        {
            BGMList.Param param = ScriptableObject.CreateInstance <BGMList.Param>();

            param.dictKey   = data[0];
            param.songTitle = data[1];
            param.Tags      = data[2].Split(',').ToList();
            param.BPM       = int.Parse(data[3]);

            if (data.Count < 4)
            {
                continue;
            }
            param.numBeatsPerSegments = (int.Parse(data[4].Split('/')[0]), int.Parse(data[4].Split('/')[1]));
            if (data.Count < 5)
            {
                continue;
            }
            param.loopTimeMarkers = (int.Parse(data[5].Split(',')[0]), int.Parse(data[5].Split(',')[1]));
            if (data.Count < 6)
            {
                continue;
            }
            param.sectionMarkers = data[6].Split(',').ToList().ConvertAll(a => double.Parse(a));
            if (data.Count < 7)
            {
                continue;
            }
            param.subTrackTimeMarkers = data.GetRange(7, data.Count - 6).Select(x => (double.Parse(x.Split(',')[0]), double.Parse(x.Split(',')[1]))).ToList();

            bgmList.Params.Add(param);

            //ここに比較処理を挟みたい
            BGMList.Param checkedParam  = ScriptableObjectLoader.Initialize <BGMList.Param>(param.dictKey); //ファイル名がdictkeyのScriptableObjectの読込/生成
            bool          isDataChanged = param.CompareParam(checkedParam);
            if (!isDataChanged)
            {
                checkedParam = param;
                BGMTimelineCreator.Create(param);
            }
        }
    }
Exemple #3
0
        void Start()
        {
            container = new UnityContainer();
            m_client  = container.RegisterSingleton <ITcpClient, TcpClient>(new InjectionConstructor(new object[] { "127.0.0.1", 3000 })).Resolve <ITcpClient>() as TcpClient;
            m_client.Start();

            container.RegisterSingleton <IProtocolContainer, ProtocolContainer>().Resolve <IProtocolContainer>();
            container.RegisterSingleton <ISendProtocol, ProtocolParser>().Resolve <ISendProtocol>();

            container.RegisterSingleton <Channel>(new InjectionConstructor(new object[] { "127.0.0.1:3001", ChannelCredentials.Insecure })).Resolve <Channel>();
            container.RegisterSingleton <PlayerData>().Resolve <PlayerData>();
            container.RegisterSingleton <IPlayer, Player>().Resolve <IPlayer>();
            container.RegisterSingleton <ISendHeartBeat, HeartBeatHandler>().Resolve <ISendHeartBeat>();
            container.RegisterSingleton <ILoginHandler, LoginHandler>().Resolve <ILoginHandler>();
            container.RegisterSingleton <ILogin, Login>().Resolve <ILogin>();
            container.RegisterSingleton <LoginAdapter>().Resolve <LoginAdapter>();

            IScriptableObjectLoader scriptableObjectLoader = new ScriptableObjectLoader();

            container.RegisterInstance <ISceneTable>(scriptableObjectLoader.LoadScriptableObject(eScriptableObject.SceneTable) as ISceneTable);
            container.RegisterInstance <IUIPrefabTable>(scriptableObjectLoader.LoadScriptableObject(eScriptableObject.UISystemTable) as IUIPrefabTable);

            container.RegisterSingleton <ISceneSystem, SceneSystem>().Resolve <ISceneSystem>();
            container.RegisterSingleton <IGameSetting, GameSetting>().Resolve <IGameSetting>();

            container.RegisterSingleton <IUILoader, UILoader>().Resolve <IUILoader>();
            container.RegisterSingleton <UIContainer>().Resolve <UIContainer>();
            container.RegisterInstance <IUIImplContainer>(new UIImplContainerBuilder(container).Create());
            container.RegisterSingleton <UIContext>().Resolve <UIContext>();
            container.RegisterSingleton <IUIView, UIView>().Resolve <IUIView>();
            container.RegisterSingleton <UIPresenter>().Resolve <UIPresenter>();
            container.RegisterSingleton <IUIController, UIController>().Resolve <IUIController>();

            container.RegisterSingleton <IGameProcessSystem, GameProcessSystem>().Resolve <IGameProcessSystem>();
            GameHost gameHost = container.RegisterSingleton <GameHost>().Resolve <GameHost>();

            gameHost.Start();

            DontDestroyOnLoad(this);
        }