private void InitCoreManager() { RegisterLog(); DontDestroyOnLoad(this.gameObject); log.Debug("Start game application..."); GameWorld.GetInstance(); LoggerView.GetInstance(); CameraLayerManager.GetInstance(); AssetLoader.GetInstance(); ViewCameraManager.GetInstance().Init(); LayerManager.GetInstance().Init(); RemoteCallLogic.GetInstance(); NGUIManager.GetInstance(); LoginController.GetInstance(); SceneLogic.GetInstance(); PlayerController.GetInstance(); BagLogic.GetInstance(); NpcLogic.GetInstance(); TimeManager.GetInstance(); ViewManager.GetInstance(); gameObject.AddComponent("CronJob"); LoadResource(); //ActiveRush.InitFx(); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan_g2")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao01_lipihuashantexiao")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan_mingzhong2")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_mingzhong")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_mingzhong_g")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_wuqifeixing")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao02_nuzhanbahuang_gongji")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_06_nuhou_shifa")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_05_zhenfei")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_04_chongfeng")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_04_chongfeng_mingzhong")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_guaiwusiwang2")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_levelup")); AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_guangquan_yellow"), PLAYER_SEL_LoadComplete, AssetType.BUNDLER); AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_guangquan2_red"), NPC_SEL_LoadComplete, AssetType.BUNDLER); PreLoad.GetInstance().OnEnterScene(); SelecterManager.GetInstance(); }
override protected void Init() { log.Debug("begin to init"); UIEventListener.Get(JobBadao.gameObject).onClick += ClickJobHandler; UIEventListener.Get(JobZhanji.gameObject).onClick += ClickJobHandler; UIEventListener.Get(JobJuchui.gameObject).onClick += ClickJobHandler; UIEventListener.Get(JobQuanren.gameObject).onClick += ClickJobHandler; UIEventListener.Get(diceBtn.gameObject).onClick += ClickDiceHandler; UIEventListener.Get(enterGameBtn.gameObject).onClick += ClickEnterGameHandler; createBadaoEffect = FindGameObject("JobBadao_effect"); createZhanjiEffect = FindGameObject("JobZhanji_effect"); createJuchuiEffect = FindGameObject("JobJuchui_effect"); createQuanrenEffect = FindGameObject("JobQuanren_effect"); JobBadao_static.gameObject.SetActive(false); JobZhanji_static.gameObject.SetActive(true); JobJuchui_static.gameObject.SetActive(true); JobQuanren_static.gameObject.SetActive(true); // 创建角色的底图 ( Sprite )").transform.localScale = new Vector3(1450, 1020, 1); ClickDiceHandler(null); if (null == loginCamera) { GameObject go = new GameObject("_loginCamera", typeof(Camera)); loginCamera = go.camera; loginCamera.CopyFrom(ViewCameraManager.GetInstance().GetUI2DCamera()); loginCamera.cullingMask = 1 << 10 | 1 << 11; loginCamera.depth = loginCamera.depth + 1; loginCamera.clearFlags = CameraClearFlags.Nothing; /*BloomAndLensFlares bloom0 = go.AddComponent<BloomAndLensFlares>(); * BloomAndLensFlares bloom1 = Camera.main.gameObject.AddComponent<BloomAndLensFlares>(); * bloom0.tweakMode = bloom1.tweakMode; * bloom0.screenBlendMode = bloom1.screenBlendMode; * bloom0.hdr = bloom1.hdr; * bloom0.lensflareIntensity = bloom1.lensflareIntensity; * bloom0.lensflareThreshhold = bloom1.lensflareThreshhold; * bloom0.bloomBlurIterations = bloom1.bloomBlurIterations; * bloom0.sepBlurSpread = bloom1.sepBlurSpread;*/ } ChangeShowPlayer(); }
void Awake() { GameObject cursorLayer = LayerManager.GetInstance().CursorLayer; GameObject go = new GameObject("cursor"); GameObject.DontDestroyOnLoad(go); go.hideFlags = HideFlags.DontSave; go.transform.parent = cursorLayer.transform; obj = go; cursor = go.AddComponent <UISprite>(); cursor.layer = int.MaxValue; cursor.atlas = UIAtlasManager.GetInstance().GetUIAtlas(ResourceAtlasName); cursor.pivot = UIWidget.Pivot.TopLeft; ObjectUtil.SetLayerWithAllChildren(cursor.gameObject, "2D"); mTrans = go.transform; RegisterCursor(); SetCursor(CursorType.ctNormal); LayerManager.ResetDepth(cursorLayer); uiCamera = ViewCameraManager.GetInstance().UICamera; }