//using Module.Log; //using UnityEngine; // //public class DebugHelper : MonoBehaviour //{ // private static GameObject helperInstance; // public static bool m_bShowEffect = true; // public static bool m_bShowDamageBoard = true; // public static bool m_bEnableTestAccount = false; // private float _heightValue = 100f; // // private float _widthValue = 150f; // private bool m_bUseOtherFun = false; // // //private int m_PlayerCount; // // //private bool m_IsSetNameHeight = false; // private string m_strSetNameHeight = ""; // // // //private GameObject sceneObj = null; // private GameObject uiRoot = null; // // // Use this for initialization // private void Start() // { // _widthValue = Screen.width * _widthValue / 2000f; // _heightValue = Screen.height * _heightValue / 1000f; // } // // public static void CreateDebugHelper() // { // if (!SdkControl.instance.IsDebugEnabled()) return; // if (null == helperInstance) helperInstance = Instantiate(Resources.Load("DebugHelper")); // // if (null == helperInstance) LogModule.DebugLog("create debughelper fail"); // } // // //void OnGUI() // // { // // //OnGUIQuality(); // // // //if (GUILayout.Button("功能", GUILayout.Height(_heightValue), GUILayout.Width(_widthValue))) // // //{ // // // m_bUseOtherFun = !m_bUseOtherFun; // // //} // // // if (m_bUseOtherFun) // // { // // // if (GUILayout.Button("HideUI", GUILayout.Height(_heightValue), GUILayout.Width(_widthValue))) // // // { // // // if (null == uiRoot) // // // { // // // uiRoot = GameObject.Find("UI Root"); // // // } // // // uiRoot.SetActive(!uiRoot.activeSelf); // // // } // // // //if (GUILayout.Button("DisConnect", GUILayout.Height(_heightValue), GUILayout.Width(_widthValue))) // // //{ // // // NetWorkLogic.GetMe().DisconnectServer(); // // //} // // // // if (GUILayout.Button("PlayerSound", GUILayout.Height(_heightValue), GUILayout.Width(_widthValue))) // // // { // // // bool bEnable = SoundManager.m_EnableBGM; // // // bEnable = !bEnable; // // // SoundManager.m_EnableBGM = bEnable; // // // SoundManager.m_EnableSFX = bEnable; // // // } // // // // if (LoginData.m_bEnableTestAccount) // // // { // // // if (GUILayout.Button("Disable TestAccount", GUILayout.Height(_heightValue), GUILayout.Width(_widthValue))) // // // { // // // LoginData.m_bEnableTestAccount = false; // // // } // // // // LoginData.m_strTestAccount = GUI.TextField(new Rect(Screen.width - 200, 0, 200, _heightValue), LoginData.m_strTestAccount, 15); // // // } // // // else // // // { // // // if (GUILayout.Button("Enable TestAccount", GUILayout.Height(_heightValue), GUILayout.Width(_widthValue))) // // // { // // // LoginData.m_bEnableTestAccount = true; // // // } // // // } // // // // if (GUILayout.Button("TerrainHeight", GUILayout.Height(_heightValue), GUILayout.Width(_widthValue))) // // // { // // // Obj_MainPlayer objMain = Singleton.GetInstance().MainPlayer; // // // if (null != objMain) // // // { // // // if (null != GameManager.gameManager.ActiveScene && // // // null != GameManager.gameManager.ActiveScene.TerrainData) // // // { // // // float height = GameManager.gameManager.ActiveScene.TerrainData.GetTerrianHeight(objMain.Position); // // // LogModule.DebugLog("Terrain Heigt: " + height); // // // return; // // // } // // // } // // // // LogModule.DebugLog("Get Terrain Height Error"); // // // } // // // // m_strSetNameHeight = GUI.TextField(new Rect(Screen.width - 200, _heightValue, 200, _heightValue), m_strSetNameHeight, 15); // // // if (GUILayout.Button("ChangeNameHeight", GUILayout.Height(_heightValue), GUILayout.Width(_widthValue))) // // // { // // // if (Singleton.Instance.MainPlayer) // // // { // // // float fNewHeight; // // // bool bResult = float.TryParse(m_strSetNameHeight, out fNewHeight); // // // if (bResult) // // // { // // // Obj_Character target = Singleton.Instance.MainPlayer.SelectTarget; // // // if (null != target) // // // { // // // BillBoard billboard = target.HeadInfoBoard.GetComponent(); // // // if (billboard != null) // // // { // // // billboard.fDeltaHeight = fNewHeight; // // // } // // // } // // // // //m_IsSetNameHeight = false; // // // } // // // // } // // // } // // // // if (GUILayout.Button("Unload unuse", GUILayout.Height(_heightValue), GUILayout.Width(_widthValue))) // // //{ // // // //BundleManager.DoUnloadUnuseBundle(); // // //} // // // // } // // } // //// /// //// /// 创建测试用Obj //// /// //// /// //// /// Root的Prefab路径 //// /// //// /// 具体模型的Prefab路径 //// /// //// /// 如果需要动态加载动作,则输入路径 //// private void CreateTestObject(string szRootPrefab, string szPrefab, string szAnimationPath) //// { //// //Obj_Character mainPlayer = Singleton.GetInstance().MainPlayer as Obj_Character; //// //if (null != mainPlayer) //// //{ //// // Vector3 newPos = mainPlayer.transform.position + new Vector3(Random.Range(-1.5f, 1.5f), 0, Random.Range(-1.5f, 1.5f)); //// // Vector3 rotate = new Vector3(0.0f, Random.Range(-180.0f, 180.0f), 0.0f); //// //// // m_MainPlayer[m_PlayerCount] = ResourceManager.InstantiateResource(szRootPrefab, "Test Player" + m_PlayerCount) as GameObject; //// // if (m_MainPlayer[m_PlayerCount]) //// // { //// // Singleton.GetInstance().ReloadModel(m_MainPlayer[m_PlayerCount], szPrefab); //// // m_MainPlayer[m_PlayerCount].transform.Translate(newPos); //// // m_MainPlayer[m_PlayerCount].transform.Rotate(rotate); //// //// // Obj_NPC objScript = m_MainPlayer[m_PlayerCount].AddComponent(); //// // if (null == objScript) //// // { //// // return; //// // } //// //// // if (m_MainPlayer[m_PlayerCount].GetComponent() == null) //// // { //// // m_MainPlayer[m_PlayerCount].AddComponent(); //// // } //// // objScript.Controller = (AIController)m_MainPlayer[m_PlayerCount].GetComponent(); //// //// // if (m_MainPlayer[m_PlayerCount].GetComponent() == null) //// // { //// // m_MainPlayer[m_PlayerCount].AddComponent(); //// // } //// // objScript.Controller.NormalAI = m_MainPlayer[m_PlayerCount].GetComponent(); //// //// // if (m_MainPlayer[m_PlayerCount].GetComponent() == null) //// // { //// // m_MainPlayer[m_PlayerCount].AddComponent(); //// // } //// // objScript.Controller.CombatAI = m_MainPlayer[m_PlayerCount].GetComponent(); //// //// // if (m_MainPlayer[m_PlayerCount].GetComponent() == null) //// // { //// // m_MainPlayer[m_PlayerCount].AddComponent(); //// // } //// // NavMeshAgent naviAgent = m_MainPlayer[m_PlayerCount].GetComponent(); //// // if (naviAgent && 0 != m_MainPlayer[m_PlayerCount].transform.localScale.x) //// // { //// // //设置成0,否则gameobject之间会互相碰撞 //// // naviAgent.radius = 0.0f; //// // naviAgent.height = 2.0f / gameObject.transform.localScale.x; //// // } //// //// // if (m_MainPlayer[m_PlayerCount].GetComponent() == null) //// // { //// // objScript.AnimLogic = m_MainPlayer[m_PlayerCount].AddComponent(); //// // } //// // objScript.AnimationFilePath = szAnimationPath; //// // objScript.InitAnimation(); //// // objScript.AnimLogic.Play(1); //// //// // if (m_MainPlayer[m_PlayerCount].GetComponent() == null) //// // { //// // m_MainPlayer[m_PlayerCount].AddComponent(); //// // } //// // objScript.InitEffect(); //// //// // objScript.Controller.SwitchCurrentAI(objScript.Controller.NormalAI); //// // } //// //// // m_PlayerCount++; //// // LogModule.DebugLog("Cur Main Player is: " + m_PlayerCount); //// //} //// } // // #region quality test // // private bool isShowQuality; // private int qualitLevel; // // private float _QualitywidthValue = 150f; // private float _QualityheightValue = 40f; // // private void OnGUIQuality() // { // if (GUI.Button(new Rect(150, 0, 150, 40), "品质:" + qualitLevel)) isShowQuality = !isShowQuality; // // if (isShowQuality) // for (var i = 0; i < 7; ++i) // if (i < 6) // { // if (GUI.Button(new Rect(150, 40 * (i + 1), 150, 40), i.ToString())) // { // qualitLevel = i; // isShowQuality = !isShowQuality; // QualitySettings.SetQualityLevel(qualitLevel); // } // } // else if (i == 6) // { // if (GUI.Button(new Rect(150, 40 * (i + 1), 150, 40), "50")) // { // qualitLevel = i; // isShowQuality = !isShowQuality; // QualitySettings.SetQualityLevel(2); // QualitySettings.pixelLightCount = 50; // } // } // } // // #endregion //}