Пример #1
0
    // Use this for initialization
    void Start()
    {
        Screen.orientation = ScreenOrientation.AutoRotation;
        Screen.autorotateToLandscapeLeft      = true;
        Screen.autorotateToLandscapeRight     = true;
        Screen.autorotateToPortrait           = false;
        Screen.autorotateToPortraitUpsideDown = false;
        Time.timeScale = 1f;

        DontDestroyOnLoad(gameObject);

        Ins = this;
        //启动MVC
        GameFacade.Instance().Startup();

        GetUIRoot();
        Transform root3 = UIRoot3D;

        Camera3D = root3.GetComponent <Camera>();

        //初始化资源管理器
        ResourceManager.Instance.Init(ResourceManagerInitComplete);
        //初始化各种SDK

        //设置全局对象池
        PoolManager.Init();
        m_defaultsprite = Resources.Load <Sprite>("notfount");

        Application.targetFrameRate = Define.GameFrameRate;
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        Screen.orientation = ScreenOrientation.AutoRotation;
        Screen.autorotateToLandscapeLeft      = true;
        Screen.autorotateToLandscapeRight     = true;
        Screen.autorotateToPortrait           = false;
        Screen.autorotateToPortraitUpsideDown = false;
        Time.timeScale = 1f;

        Application.runInBackground = true;

        DontDestroyOnLoad(gameObject);

        //if (null == m_demo)
        //m_demo = gameObject.AddComponent<BuglyCrash>();

        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        Ins = this;
        //启动MVC
        GameFacade.Instance().Startup();

        GetUIRoot();
        Transform root3 = UIRoot3D;

        //初始化资源管理器
        ResourceManager.Instance.Init(ResourceManagerInitComplete);
        //初始化各种SDK

        //设置全局对象池
        PoolManager.Init();
        m_defaultsprite = Resources.Load <Sprite>("notfount");

        Application.targetFrameRate = Define.GameFrameRate;

        NSocket.GetInstance().SetIpAddress("47.96.5.212", 12345);
        //NSocket.GetInstance().SetIpAddress("192.168.2.55", 12345);
        //NSocket.GetInstance().SetIpAddress("192.168.2.144", 12345);
        //NSocket.GetInstance().SetIpAddress("192.168.2.127", 12345);
        //NSocket.GetInstance().SetIpAddress("47.96.5.212",12345);
        NSocket.GetInstance().ConnectServer();
        NetDataMgr.Instance.Init();

        PanelManager pm = PanelManager.Instance;

        Debug.Log("程序集版本:" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
    }