Пример #1
0
        void Start()
        {
            _fishCamera  = transform.Find("Cameras/FishCamera");
            _sceneCamera = transform.Find("Cameras/SceneCamera");
            AssetManager.getInstance().intialize();
            GameSceneManager.sceneCameraObj = _sceneCamera.gameObject;
            _bStartUp = true;
            PlayerManager.getInstance().init();
            FishPathDataMgr.getInstance().initialize();
            base.Start();
            _startUpStep = 1;
            Transform tr = transform.Find("World/Container/FishBox");

            tr.localRotation = Quaternion.Euler(new Vector3(90f, 0f, 0f));
            Transform tr_ptct = transform.Find("World/Container/ptct");

            tr_ptct.localRotation = Quaternion.Euler(new Vector3(90f, 0f, 0f));
            if (_fishCamera != null)
            {
                Transform ct = transform.Find("World/Container");
                float     z  = ct.localPosition.z;
                float     h  = Mathf.Tan(3.1415926f / 4f) * z;
                _fishCamera.localPosition = new Vector3(0f, h, 0f);
                UIPanel panel = transform.Find("World/Container/Panel").GetComponent <UIPanel>();
                panel.renderQueue         = UIPanel.RenderQueue.StartAt;
                panel.startingRenderQueue = 2000;
                tf_background             = transform.Find("World/Container/Panel/Texture");
                tf_background.LookAt(_fishCamera);
            }
        }
Пример #2
0
 // Update 每帧调用一次
 override public void Update()
 {
     if (!_bStartUp)
     {
         return;
     }
     if (_startUpStep == 1 && AssetManager.getInstance().IsInitComplete())
     {
         ConfigDataMgr.getInstance().initialize();
         _startUpStep = 2;
     }
     else if (_startUpStep == 2)
     {
         ConfigDataMgr.getInstance().initialize();
         _startUpStep = 3;
     }
     else if (_startUpStep == 3 && ConfigDataMgr.getInstance().IsAllConfigLoaded())
     {
         if (mono != null)
         {
             modelId = mono.modelId;
         }
         _3DModelCreating = PlayerManager.getInstance().createModel(modelId, OnCreateModelCB, Vector3.zero);
         _startUpStep     = 4;
     }
     else if ((_startUpStep == 4 && mono != null && (pathid != mono.selectPath || modelId != mono.modelId)))
     {
         FishPathDataMgr.getInstance().initialize();
         //path.fishPathID = mono.selectPath;
         pathid  = mono.selectPath;
         modelId = mono.modelId;
         _3DModelCreating.destroy();
         _3DModelCreating   = PlayerManager.getInstance().createModel(modelId, OnCreateModelCB, Vector3.zero);
         mono.isChangeModel = false;
     }
     else if (mono.isChangeModel && _startUpStep == 4)
     {
         FishPathDataMgr.getInstance().initialize();
         //path.fishPathID = mono.selectPath;
         pathid  = mono.selectPath;
         modelId = mono.modelId;
         _3DModelCreating.destroy();
         _3DModelCreating   = PlayerManager.getInstance().createModel(modelId, OnCreateModelCB, Vector3.zero);
         mono.isChangeModel = false;
     }
     base.Update();
 }
Пример #3
0
    //初始化第3步
    void InitData_Step3()
    {
        //配置文件管理类初始化
        //GameSceneManager.getInstance().initialize();

        /*
         #if UNITY_EDITOR
         #elif UNITY_ANDROID
         * JARUtilTools tools = GameSceneManager.uiCameraObj.GetComponent<JARUtilTools>();
         * if (tools != null)
         *  tools.startLocalNotification();
         #elif UNITY_IOS
         * LocalNotificationMgr.getInstance().initialize();
         #endif
         * */
        //PathXMLMgr.getInstance().init();
        FishPathDataMgr.getInstance().initialize();
        Utils.LogSys.Log("ApplicationMgr DataInit Step3 OK----->" + (Time.realtimeSinceStartup - _lastLogTime).ToString());
        _lastLogTime = Time.realtimeSinceStartup;
        _initOKStep  = 3;
        InitData_Step4();
    }