private void ExitBluePrintMode() { YHDebug.Log("exit bp mode"); m_EnterFactoryBPMode = false; m_BPBuild = false; m_BPCreate = false; m_FactoryBPUI.ExitBP(); m_FactoryBP.Clear(); }
protected override void _OnClose() { YHDebug.Log("bp create close"); m_SelectEntities.Clear(); m_NeedRemoveGizmosKeys.Clear(); foreach (var iter in m_SelectEntitiesGizmo) { iter.Value.Close(); } m_SelectEntitiesGizmo.Clear(); }
private void EnterBluePrintMode() { YHDebug.Log("enter bp mode"); m_EnterFactoryBPMode = true; //check planet data PlanetData planetData = GameMain.localPlanet; if (planetData != null && planetData != m_FactoryBP.planetData) { m_FactoryBP.SetPlanetData(planetData); m_FactoryBP.player = GameMain.mainPlayer; } m_FactoryBPUI.EnterBP(); }
void Update() { //进入蓝图模式或退出 if (GameMain.mainPlayer != null && GameMain.mainPlayer.controller != null && GameMain.mainPlayer.controller.cmd.type == ECommand.Build) { //更新键盘事件 KeyManager.Instance.Update(); if (m_BPEnterKey.IsDown() || m_AutoEnterBPMode) { m_AutoEnterBPMode = false; if (m_EnterFactoryBPMode) { ExitBluePrintMode(); } else { EnterBluePrintMode(); } } } else if (m_EnterFactoryBPMode) { m_AutoEnterBPMode = true; //退出蓝图模式 ExitBluePrintMode(); return; } //蓝图功能 if (m_EnterFactoryBPMode) { if (m_CreateBluePrintKey.IsDown()) { YHDebug.Log("On create bp Key down"); m_BPCreate = true; m_BPBuild = false; } if (m_BuildBluePrintKey.IsDown()) { YHDebug.Log("On build bp entities Key down"); //build //CreateBuildPreviews(Input.mousePosition); m_BPBuild = true; m_BPCreate = false; } if (m_SaveBPKey.IsDown()) { YHDebug.Log("On save bp Key down"); //save SaveCurrentBPData(); } if (m_ExportLapJointKey.IsDown()) { ExportModelLapJot(); } //if (m_BPBuild) //{ // //取消build // if (Input.GetMouseButtonDown(1) && (!Input.GetKey(KeyCode.LeftShift) && !Input.GetKey(KeyCode.RightShift))) // { // m_BPBuild = false; // } //} //if (m_BPCreate) //{ // //取消create // if (Input.GetMouseButtonDown(1) && (!Input.GetKey(KeyCode.LeftShift) && !Input.GetKey(KeyCode.RightShift))) // { // m_BPCreate = false; // } //} } }
protected override void _OnOpen() { YHDebug.Log("bp create open"); }