Exemple #1
0
    /// <summary>
    /// 核心内容,初始化网络NetWork,游戏配置数据初始化
    /// </summary>
    void InitGame()
    {
        Container = gameObject;
        DontDestroyOnLoad(Container);
        Controller      = Container.GetComponent <GameController>();
        SoundManager    = Container.GetComponent <SoundManager>();
        SoundController = Container.GetComponent <SoundController>();
        NonStopTime     = Container.GetComponent <NonStopTime>();
        //添加调试输出面板
        //DebugConsole = Container.AddComponent<DebugConsole>();
        //DebugConsole.Init();

        // 初始化随机种子
        UnityEngine.Random.seed = System.Environment.TickCount;
        UnityEngine.Random.seed = System.DateTime.Today.Millisecond;

        // 初始化动画插件(需要注意,这是全局的动画系统,全局设置时不会自动消耗
        // 所有需要主要在游戏切换的时候记得统一销毁
        DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(1000, 0);
    }
Exemple #2
0
    /// <summary>
    /// 核心内容,初始化网络NetWork,游戏配置数据初始化
    /// </summary>
    void InitGame()
    {
        Container = gameObject;
        DontDestroyOnLoad(Container);
        Controller      = Container.GetComponent <GameController>();
        PlayerManager   = Container.GetComponent <PlayerManager>();
        GameMode        = Container.GetComponent <GameMode>();
        SoundManager    = Container.GetComponent <SoundManager>();
        SoundController = Container.GetComponent <SoundController>();
        NonStopTime     = Container.GetComponent <NonStopTime>();
        GameTime        = Container.GetComponent <GameTime>();
        RankManager     = Container.GetComponent <RankManager>();
        IOManager       = Container.GetComponent <IOManager>();
        SettingManager  = Container.GetComponent <SettingManager>();

        //添加调试输出面板
        //Panel = Container.AddComponent<DebugConsole>();
        //Panel.Init();

        //主摄像机
        MainCamera = GameObject.Find("Main Camera");

        // 初始化随机种子
        UnityEngine.Random.seed = System.Environment.TickCount;
        UnityEngine.Random.seed = System.DateTime.Today.Millisecond;

        // 初始化动画插件(需要注意,这是全局的动画系统,全局设置时不会自动消耗
        // 所有需要主要在游戏切换的时候记得统一销毁
        DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(1000, 10);

        // 初始化输入设备
        IOManager.Init(GameConfig.GAME_CONFIG_PLAYER_COUNT);
        Controller.Init(GameController.InputType.External);

        PlayerManager.Init();
    }