public void setNoDestroyObject() { Ctx.m_instance.m_layerMgr.m_path2Go[NotDestroyPath.ND_CV_Root] = UtilApi.GoFindChildByPObjAndName(NotDestroyPath.ND_CV_Root); //UtilApi.DontDestroyOnLoad(Ctx.m_instance.m_layerMgr.m_path2Go[NotDestroyPath.ND_CV_Root]); setNoDestroyObject_impl(NotDestroyPath.ND_CV_App, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UICanvas_50, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UICanvas_100, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UICamera, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_EventSystem, NotDestroyPath.ND_CV_Root); // NGUI 2.7.0 之前的版本,编辑器会将 width and height 作为 transform 的 local scale ,因此需要手工重置 setNoDestroyObject_impl(NotDestroyPath.ND_CV_UIBtmLayer_Canvas_50, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UIFirstLayer_Canvas_50, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UISecondLayer_Canvas_50, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UIThirdLayer_Canvas_50, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UIForthLayer_Canvas_50, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UITopLayer_Canvas_50, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UIBtmLayer_Canvas_100, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UIFirstLayer_Canvas_100, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UISecondLayer_Canvas_100, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UIThirdLayer_Canvas_100, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UIForthLayer_Canvas_100, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UITopLayer_Canvas_100, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UIModel, NotDestroyPath.ND_CV_Root); setNoDestroyObject_impl(NotDestroyPath.ND_CV_UILight, NotDestroyPath.ND_CV_Root); }
public void findWidget() { if (EnDZPlayer.ePlayerSelf == m_playerSide) { m_text = new AuxLabel(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.SelfMpText)); } else { m_text = new AuxLabel(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.EnemyMpText)); } if (EnDZPlayer.ePlayerSelf == m_playerSide) { m_mpGrid = new UIGrid(); m_mpGrid.setGameObject(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.SelfMpList)); m_mpGrid.maxPerLine = 1; m_mpGrid.cellWidth = 0.5f; m_mpGrid.cellHeight = 0.5f; } else { m_mpGrid = new UIGrid(); m_mpGrid.setGameObject(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.EnemyMpList)); m_mpGrid.maxPerLine = 10; m_mpGrid.cellWidth = 0.5f; m_mpGrid.cellHeight = 0.5f; } }
// 进入场景,场景资源加载成功 public void quitedAndEnteredStageHandle(EGameStage srcGameState, EGameStage destGameState) { // 播放音乐 //SoundParam param = Ctx.m_instance.m_poolSys.newObject<SoundParam>(); //param.m_path = Path.Combine(Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathAudio], "ZuiZhenDeMeng.mp3"); //Ctx.m_instance.m_soundMgr.play(param); //Ctx.m_instance.m_poolSys.deleteObj(param); if (EGameStage.eStage_Login == srcGameState) { initOnFirstEnterGameScene(); } if (EGameStage.eStage_Game == destGameState) { Ctx.m_instance.m_logSys.log("场景加载成功"); loadAllUIScene(); Ctx.m_instance.m_camSys.m_boxCam.setGameObject(UtilApi.GoFindChildByPObjAndName("mcam")); Ctx.m_instance.m_sceneEventCB.onLevelLoaded(); Ctx.m_instance.m_camSys.setSceneCamera2UICamera(); } else if (EGameStage.eStage_DZ == destGameState) { Ctx.m_instance.m_camSys.setSceneCamera2MainCamera(); Ctx.m_instance.m_dataPlayer.m_dzData.clear(); Ctx.m_instance.m_dataPlayer.m_dzData.m_canReqDZ = true; // 进入对战就设置这个标示位为可以继续战斗 Ctx.m_instance.m_camSys.m_dzCam = new DzCam(); loadAllDZUIScene(); } }
public void init() { string path = "RootGo/AgentGo"; this.selfGo = UtilApi.GoFindChildByPObjAndName(path); m_mazePlayerTrackAniControl = new MazePlayerTrackAniControl(this); m_sceneEffect = Ctx.m_instance.m_sceneEffectMgr.addSceneEffect(31, this.selfGo, false, true, true); m_sceneEffect.setKeepLastFrame(true); }
// 添加事件监听 protected void addEventHandle() { //UtilApi.addEventHandle(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.LuckyCoin), onLuckyCoinBtnClk); // 点击幸运币 UtilApi.addEventHandle(m_sceneDZData.m_placeHolderGo.m_startGO, onStartBtnClk); // 开始游戏 UtilApi.addHoverHandle(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.MyCardDeap), onSelfStartHover); UtilApi.addHoverHandle(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.EnemyCardDeap), onEnemyStartHover); UtilApi.addEventHandle(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.CollideBG), onClkBg); // 监听点击背景事件 }
public void findWidget() { m_roundBtn.setGameObject(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.TurnBtn)); m_roundBtn.m_sceneDZData = m_sceneDZData; //m_luckCoin.setGameObject(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.LuckyCoin)); m_selfRoundTip.setGameObject(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.SelfTurnTip)); m_selfCardFullTip.setGameObject(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.SelfCardFullTip)); m_selfCardFullTip.desc = new AuxLabel(m_selfCardFullTip.gameObject(), CVSceneDZPath.SelfCardFullTipText); m_selfCardFullTip.hide(); m_fightResultPanel.setGameObject(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.FightResultPanel)); m_fightResultPanel.hide(); m_startBtn.setGameObject(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.StartGO)); }
public void init() { m_sceneDZAreaArr[(int)EnDZPlayer.ePlayerSelf] = new SelfDZArea(this, EnDZPlayer.ePlayerSelf); m_sceneDZAreaArr[(int)EnDZPlayer.ePlayerEnemy] = new EnemyDZArea(this, EnDZPlayer.ePlayerEnemy); m_sceneDZAreaArr[(int)EnDZPlayer.ePlayerSelf].init(); m_sceneDZAreaArr[(int)EnDZPlayer.ePlayerEnemy].init(); m_historyArea = new HistoryArea(UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.HistoryGo)); m_historyArea.m_sceneDZData = this; m_attackArrow = new AttackArrow(this); m_gameOpState = new GameOpState(this); m_sceneDZAreaArr[(int)EnDZPlayer.ePlayerSelf].crystalPtPanel.findWidget(); m_sceneDZAreaArr[(int)EnDZPlayer.ePlayerEnemy].crystalPtPanel.findWidget(); }
public void findWidget() { m_centerGO = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.CenterGO); m_startGO = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.StartGO); //UtilApi.SetActive(m_startGO, false); // 默认是隐藏的 m_cardCenterGOArr[(int)EnDZPlayer.ePlayerSelf, (int)CardArea.CARDCELLTYPE_NONE] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.SelfStartCardCenterGO); m_cardCenterGOArr[(int)EnDZPlayer.ePlayerEnemy, (int)CardArea.CARDCELLTYPE_NONE] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.EnemyStartCardCenterGO); m_cardCenterGOArr[(int)EnDZPlayer.ePlayerSelf, (int)CardArea.CARDCELLTYPE_COMMON] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.SelfOutCardCenterGO); m_cardCenterGOArr[(int)EnDZPlayer.ePlayerEnemy, (int)CardArea.CARDCELLTYPE_COMMON] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.EnemyOutCardCenterGO); m_cardCenterGOArr[(int)EnDZPlayer.ePlayerSelf, (int)CardArea.CARDCELLTYPE_HAND] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.SelfCardCenterGO); m_cardCenterGOArr[(int)EnDZPlayer.ePlayerEnemy, (int)CardArea.CARDCELLTYPE_HAND] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.EnemyCardCenterGO); m_cardCenterGOArr[(int)EnDZPlayer.ePlayerSelf, (int)CardArea.CARDCELLTYPE_EQUIP] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.SelfEquipGO); m_cardCenterGOArr[(int)EnDZPlayer.ePlayerEnemy, (int)CardArea.CARDCELLTYPE_EQUIP] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.EnemyEquipGO); m_cardCenterGOArr[(int)EnDZPlayer.ePlayerSelf, (int)CardArea.CARDCELLTYPE_SKILL] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.SelfSkillGO); m_cardCenterGOArr[(int)EnDZPlayer.ePlayerEnemy, (int)CardArea.CARDCELLTYPE_SKILL] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.EnemySkillGO); m_cardCenterGOArr[(int)EnDZPlayer.ePlayerSelf, (int)CardArea.CARDCELLTYPE_HERO] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.SelfHeroGO); m_cardCenterGOArr[(int)EnDZPlayer.ePlayerEnemy, (int)CardArea.CARDCELLTYPE_HERO] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.EnemyHeroGO); m_cardHandRadiusGO = new GameObject[2]; m_cardHandRadiusGO[0] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.SelfCardHandRadiusGO); m_cardHandRadiusGO[1] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.EnemyCardHandRadiusGO); m_cardHandAreaWidthArr = new float[2]; m_cardHandAreaWidthArr[0] = m_cardHandRadiusGO[0].transform.localPosition.x - m_cardCenterGOArr[(int)EnDZPlayer.ePlayerSelf, (int)CardArea.CARDCELLTYPE_HAND].transform.localPosition.x; m_cardHandAreaWidthArr[1] = m_cardHandRadiusGO[1].transform.localPosition.x - m_cardCenterGOArr[(int)EnDZPlayer.ePlayerEnemy, (int)CardArea.CARDCELLTYPE_HAND].transform.localPosition.x; m_cardCommonRadiusGO = new GameObject[2]; m_cardCommonRadiusGO[0] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.SelfCardCommonRadiusGO); m_cardCommonRadiusGO[1] = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.EnemyCardCommonRadiusGO); m_cardCommonAreaWidthArr = new float[2]; m_cardCommonAreaWidthArr[0] = m_cardCommonRadiusGO[0].transform.localPosition.x - m_cardCenterGOArr[(int)EnDZPlayer.ePlayerSelf, (int)CardArea.CARDCELLTYPE_HAND].transform.localPosition.x; m_cardCommonAreaWidthArr[1] = m_cardCommonRadiusGO[1].transform.localPosition.x - m_cardCenterGOArr[(int)EnDZPlayer.ePlayerEnemy, (int)CardArea.CARDCELLTYPE_HAND].transform.localPosition.x; m_timerGo = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.TimerGo); m_attackArrowGO = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.ArrowStartPosGO); m_arrowListGO = UtilApi.GoFindChildByPObjAndName(CVSceneDZPath.ArrowListGO); if (m_cardHandAreaWidthArr[0] < 0) { m_cardHandAreaWidthArr[0] = (-m_cardHandAreaWidthArr[0]); } if (m_cardHandAreaWidthArr[1] < 0) { m_cardHandAreaWidthArr[1] = (-m_cardHandAreaWidthArr[1]); } if (m_cardCommonAreaWidthArr[0] < 0) { m_cardCommonAreaWidthArr[0] = (-m_cardCommonAreaWidthArr[0]); } if (m_cardCommonAreaWidthArr[1] < 0) { m_cardCommonAreaWidthArr[1] = (-m_cardCommonAreaWidthArr[1]); } }
public override void onReady() { base.onReady(); m_sceneTipsData.m_goRoot = UtilApi.GoFindChildByPObjAndName("SceneTipsUI"); m_sceneTipsData.m_goRoot.SetActive(false); // 默认隐藏 }