/// <summary> /// 设置反外挂信息 /// </summary> /// <param name="rootnode"></param> static void SetAccInfo(XMLNode rootnode) { if (rootnode == null) { LogSystem.LogWarning("SetAccInfo is null"); return; } XMLNodeList xmlNodeList = rootnode.GetNodeList("Resources>0>Acc>0>Property"); if (xmlNodeList == null) { LogSystem.LogWarning("SetAccInfo is null"); return; } foreach (XMLNode n in xmlNodeList) { string strID = n.GetValue("@No"); if (accInfo.ContainsKey(strID)) { accInfo[strID].Add(n.GetValue("@Name")); } else { List <string> info = new List <string>(); info.Add(n.GetValue("@Name")); accInfo.Add(strID, info); } } }
private void OnPostRender() { if (!this.mat) { LogSystem.LogWarning(new object[] { "Please Assign a material on the inspector" }); return; } GL.PushMatrix(); this.mat.SetPass(0); GL.LoadOrtho(); for (int i = 0; i < this._rectList.Count; i++) { Rect rect = this._rectList[i]; GL.Begin(4); GL.Color(this._col); GL.Vertex(this.GetNormalizePos(new Vector3(rect.xMax, rect.yMin, 0f))); GL.Vertex(this.GetNormalizePos(new Vector3(rect.xMin, rect.yMin, 0f))); GL.Vertex(this.GetNormalizePos(new Vector3(rect.xMax, rect.yMax, 0f))); GL.Vertex(this.GetNormalizePos(new Vector3(rect.xMin, rect.yMax, 0f))); GL.Vertex(this.GetNormalizePos(new Vector3(rect.xMax, rect.yMax, 0f))); GL.Vertex(this.GetNormalizePos(new Vector3(rect.xMin, rect.yMin, 0f))); GL.End(); } GL.PopMatrix(); }
protected void Start() { this.Upgrade(); if (Application.isPlaying) { if (this.mFG == null) { LogSystem.LogWarning(new object[] { "Progress bar needs a foreground widget to work with", this }); base.enabled = false; return; } if (this.mBG != null) { this.mBG.autoResizeBoxCollider = true; } this.OnStart(); if (this.onChange != null) { UIProgressBar.current = this; EventDelegate.Execute(this.onChange); UIProgressBar.current = null; } } this.ForceUpdate(); }
private static void SetAccInfo(XMLNode rootnode) { if (rootnode == null) { LogSystem.LogWarning(new object[] { "SetAccInfo is null" }); return; } XMLNodeList nodeList = rootnode.GetNodeList("Resources>0>Acc>0>Property"); if (nodeList == null) { LogSystem.LogWarning(new object[] { "SetAccInfo is null" }); return; } foreach (XMLNode xMLNode in nodeList) { string value = xMLNode.GetValue("@No"); if (Config.accInfo.ContainsKey(value)) { Config.accInfo[value].Add(xMLNode.GetValue("@Name")); } else { List <string> list = new List <string>(); list.Add(xMLNode.GetValue("@Name")); Config.accInfo.Add(value, list); } } }
/// <summary> /// 更新指定材质的shader, /// </summary> /// <param name="mt"></param> /// <param name="args">待适配的shader列表</param> public static void ChangeShader(Material mt, params string[] args) { Shader[] array = new Shader[args.Length]; for (int i = 0; i < args.Length; i++) { array[i] = Shader.Find(args[i]); if (array[i] == null) { LogSystem.LogWarning(new object[] { "shader not found" }); } } for (int j = 0; j < args.Length; j++) { if (!(array[j] == null)) { string value = args[j].Substring(0, args[j].Length - 1); if (mt.shader.name.Equals(value)) { mt.shader = array[j]; break; } } } }
private void Awake() { GuideUI.Instance = this; GameObject gameObject = GameObject.FindWithTag("UICamera"); if (gameObject == null) { return; } this.uiCamera = gameObject.GetComponent <Camera>(); if (this.uiCamera == null) { LogSystem.LogWarning(new object[] { "UICamera is not find" }); return; } if (this.uiCamera.gameObject.GetComponent <UICamera>() == null) { this.uiCamera.gameObject.AddComponent <UICamera>(); } if ((float)ResolutionConstrain.Instance.width * 1f / (float)ResolutionConstrain.Instance.height >= 1.77777779f) { this.uiCamera.orthographicSize = 720f / (float)ResolutionConstrain.Instance.height; } else { this.uiCamera.orthographicSize = 1280f / (float)ResolutionConstrain.Instance.width; } }
public static void SetCacheVersion(string strCacheVersion) { string @string = PlayerPrefs.GetString("CacheVersion", string.Empty); if (string.IsNullOrEmpty(@string) || strCacheVersion != @string) { PlayerPrefs.SetString("CacheVersion", strCacheVersion); Caching.CleanCache(); } Config.iCacheVersion = 0; if (string.IsNullOrEmpty(strCacheVersion)) { LogSystem.LogWarning(new object[] { "Version Error ", strCacheVersion }); return; } string text = strCacheVersion.Replace(".", string.Empty); if (string.IsNullOrEmpty(text)) { LogSystem.LogWarning(new object[] { "Version Error ", text }); return; } Config.iCacheVersion = int.Parse(text); }
static void OnNetBlockOrClose() { try { //Debug.Log("OnNetBlockOrClose"); gConnectCount = 0; WorldStage.mbReConnected = true; //启动断线重连,重新发送登录消息 Game game = Game.Instance; if (game != null) { game.mGameSock.Disconnect(); game.mGameSock.InitUserSock(); ConnectStage.RegistCallback(false); LoginStage.RegistCallback(false); WorldStage.RegistCallback(false); ///第一次连接失败,添加心跳开始持续一分钟连接12次,依然没有连上认为断开 ConnectStage.ConnecToMember(mstrServer, miPort, mstrUser, mstrPsd, mstrValidateString, 2); //Debug.Log("第一次重连"); TimerManager.AddTimerRepeat("OnNetBlockTimer", 5.0f, OnNetBlockTimer); LogSystem.LogWarning("First block connect try"); //SystemWaitPanel.Start(99999999); } } catch (System.Exception ex) { LogSystem.LogError("Game::OnNetBlockOrClose:", ex.ToString()); } }
protected override bool Init() { if (!VCPluginSettings.EzguiEnabled(base.gameObject)) { return(false); } if (!base.Init()) { return(false); } if (this.colliderObject == this.movingPart) { LogSystem.LogWarning(new object[] { "VCAnalogJoystickEzgui may not behave properly when the colliderObject is the same as the movingPart! ", "You should add a Collider to a gameObject independent from the EZGUI UI components." }); } this._movingPartBehaviorComponent = this.GetEzguiBehavior(this.movingPart); if (this._movingPartBehaviorComponent == null) { VCUtils.DestroyWithError(base.gameObject, "Cannot find a SimpleSprite or UIButton component on movingPart. Destroying this control."); return(false); } if (this._collider == null) { VCUtils.DestroyWithError(base.gameObject, "No collider attached to colliderGameObject! Destroying this control."); return(false); } return(true); }
/// <summary> /// 返回位于 对象池 开始处的对象并将其移除对象池。 /// </summary> /// <returns></returns> public virtual T PopItem() { if (mPools == null) { LogSystem.LogWarning("Pools is not Create"); return(default(T)); } else { if (mPools.Count > 0) { T o = mPools.Dequeue(); if (o is GameObject) { return((T)o); } else if (o is IObject) { (o as IObject).Reset(); } return((T)o); } else { return(InstantiateItem()); } } }
public static void Add(List <EventDelegate> list, EventDelegate ev, bool oneShot) { if (ev.mRawDelegate || ev.target == null || string.IsNullOrEmpty(ev.methodName)) { EventDelegate.Add(list, ev.mCachedCallback, oneShot); } else if (list != null) { int i = 0; int count = list.Count; while (i < count) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(ev)) { return; } i++; } list.Add(new EventDelegate(ev.target, ev.methodName) { oneShot = oneShot }); } else { LogSystem.LogWarning(new object[] { "Attempting to add a callback to a list that's null" }); } }
public void LoadScriptLib() { LogSystem.LogWarning(new object[] { "LoadScriptLib" }); this.muiGuide.ShowInfo(Config.GetUdpateLangage("LoaderScript")); string str = string.Empty; if (Config.mbMd5) { str = this.GetMd5(Encoding.Default.GetBytes("GameLib")); } else { str = "GameLib"; } string text = Config.GetAssetBundleRootPath() + "/" + str + ".unity3d"; if (File.Exists(text)) { string strFilePath = Config.GetPreSuffix() + text; base.StartCoroutine(this.LoadScriptLib(strFilePath, new Reflecter.OnFileLoaded(this.OnLoadLibrarySucc), new Reflecter.OnFileError(this.OnLoadLibraryError))); } }
/// <summary> /// Append a new event delegate to the list. /// </summary> static public void Add(List <EventDelegate> list, EventDelegate ev, bool oneShot) { if (ev.mRawDelegate || ev.target == null || string.IsNullOrEmpty(ev.methodName)) { Add(list, ev.mCachedCallback, oneShot); } else if (list != null) { for (int i = 0, imax = list.Count; i < imax; ++i) { EventDelegate del = list[i]; if (del != null && del.Equals(ev)) { return; } } EventDelegate ed = new EventDelegate(ev.target, ev.methodName); ed.oneShot = oneShot; list.Add(ed); } else { LogSystem.LogWarning("Attempting to add a callback to a list that's null"); } }
/// <summary> /// 开始连接 /// </summary> /// <param name="addr">地址</param> /// <param name="port">端口号</param> /// <returns></returns> public bool Open(string addr, int port) { LogSystem.LogWarning(addr, port); if (m_Socket == null || m_State == SockState.Failed) { InitSock(null); Init(); } if (m_State != SockState.Idle) { return(false); } m_nError = 0; if (addr.Length > 0) { m_sAddr = addr; m_nPort = port; } try { IPAddress ipad = IPAddress.Parse(m_sAddr); IPEndPoint ipe = new IPEndPoint(ipad, m_nPort); SetSockState(SockState.Connecting); m_Socket.BeginConnect(ipe, new AsyncCallback(SockAsync.Connect), this); } catch (SocketException e) { SetSockError(e.ErrorCode, e.ToString()); SetSockState(SockState.Failed); return(false); } return(true); }
/// <summary> /// 搜索移动路径 /// </summary> /// <param name="pTarget"></param> /// <param name="speed"></param> /// <param name="continuWithInterr"></param> /// <param name="delayTick"></param> /// <param name="sysInvoke"></param> public void FindPathMove(Vector3 pTarget, float speed, bool continuWithInterr, int delayTick = 0, bool sysInvoke = false) { if (!sysInvoke) { this.Stop(); } this.target = this.position; float num = GameScene.mainScene.SampleHeight(pTarget, true); if (num < 10f) //目标点高度小于10,停止寻路 { this.Stop(); if (GameScene.isEditor) { LogSystem.LogWarning(new object[] { string.Concat(new object[] { this.pfWrongTip, this.target, "; 失败场景ID:", GameScene.mainScene.sceneID }) }); } return; } this.pathInterrupted = false; if (!GameScene.mainScene.IsValidForWalk(pTarget, this.collisionSize)) //目标点不可通行,停止 { float num2 = pTarget.x - this.position.x; float num3 = pTarget.z - this.position.z; if (Mathf.Sqrt(num2 * num2 + num3 * num3) < 4f) //碰撞范围内 { this.pathInterrupted = false; } this.Stop(); if (GameScene.isEditor) { LogSystem.LogWarning(new object[] { string.Concat(new object[] { this.pfWrongTip, this.target, "; 失败场景ID:", GameScene.mainScene.sceneID }) }); } return; } this.pathFindEnd = false; this.delayTick = delayTick; this.curDelayTick = delayTick; this.continuWithInterr = continuWithInterr; this.speed = speed; this.pathFindTarget = pTarget; this.scene.mapPath.RequestPaths(this.position, pTarget, this.collisionSize, new MapPath.PathFindEndBack(this.OnPathFindEnd), 8000); }
public override void FireEvent() { if (this.levelName.Length == 0 && this.levelIndex < 0) { LogSystem.LogWarning(new object[] { "You have a Load Level event in your sequence, however, you didn't give it a level to load." }); return; } if (this.levelIndex >= Application.levelCount) { LogSystem.LogWarning(new object[] { "You tried to load a level that is invalid, the level index is out of range." }); return; } if (!Application.isPlaying && !this.fireInEditor) { LogSystem.Log(new object[] { "Load Level Fired, but it wasn't processed, since we are in the editor. Please set the fire In Editor flag in the inspector if you require this behaviour." }); return; } if (this.levelName.Length != 0) { Application.LoadLevel(this.levelName); } if (this.levelIndex != -1) { Application.LoadLevel(this.levelIndex); } }
protected new void OnSelectEvent() { UIInput.selection = this; if (this.mDoInit) { this.Init(); } LogSystem.LogWarning(new object[] { "keyBoard open 1" }); if (this.newLabel != null && NGUITools.GetActive(this)) { this.newLabel.labelText.color = this.activeTextColor; if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android) { UIInput.mKeyboard = ((this.inputType != UIInput.InputType.Password) ? TouchScreenKeyboard.Open(this.mValue, (TouchScreenKeyboardType)this.keyboardType, this.inputType == UIInput.InputType.AutoCorrect, this.newLabel.labelText.multiLine, false, false, this.defaultText) : TouchScreenKeyboard.Open(this.mValue, TouchScreenKeyboardType.Default, false, false, true)); if (Config.bANYSDK) { } } else { Vector2 compositionCursorPos = (!(UICamera.current != null) || !(UICamera.current.cachedCamera != null)) ? this.newLabel.labelText.worldCorners[0] : UICamera.current.cachedCamera.WorldToScreenPoint(this.newLabel.labelText.worldCorners[0]); compositionCursorPos.y = (float)ResolutionConstrain.Instance.height - compositionCursorPos.y; Input.imeCompositionMode = IMECompositionMode.On; Input.compositionCursorPos = compositionCursorPos; UIInput.mDrawStart = 0; } this.UpdateLabel(); } }
private void OnLoadLibraryError(WWW www) { LogSystem.LogWarning(new object[] { "OnLoadLibraryError:" }); string str = string.Empty; if (Config.mbMd5) { str = this.GetMd5(Encoding.Default.GetBytes("GameLib")); } else { str = "GameLib"; } string str2 = Config.GetStreamRootPath() + "/" + str + ".unity3d"; string text = Config.GetStreamSuffix() + str2; base.StartCoroutine(this.LoadScriptLib(text, new Reflecter.OnFileLoaded(this.OnLoadLibrarySucc2), new Reflecter.OnFileError(this.OnLoadLibraryError2))); LogSystem.LogWarning(new object[] { "OnLoadLibraryError: strFile2:", text }); }
/// <summary> /// Register the event listeners. /// </summary> protected void Start() { Upgrade(); if (Application.isPlaying) { if (mFG == null) { LogSystem.LogWarning("Progress bar needs a foreground widget to work with", this); enabled = false; return; } if (mBG != null) { mBG.autoResizeBoxCollider = true; } OnStart(); if (onChange != null) { current = this; EventDelegate.Execute(onChange); current = null; } } ForceUpdate(); }
protected void InitGameObjects() { if (this.upStateObject == null && this.pressedStateObject == null) { LogSystem.LogWarning(new object[] { "No up or pressed state GameObjects specified! Setting upStateObject to this.gameObject." }); this.upStateObject = base.gameObject; } if (this.colliderObject == null) { GameObject arg_73_1; if ((arg_73_1 = this.upStateObject) == null) { arg_73_1 = (this.pressedStateObject ?? base.gameObject); } this.colliderObject = arg_73_1; } base.InitCollider(this.colliderObject); if (this._requireCollider && this._collider == null) { VCUtils.DestroyWithError(base.gameObject, "colliderObject must have a Collider component! Destroying this control."); return; } }
private void OnLoadLibrarySucc2(WWW www) { LogSystem.LogWarning(new object[] { "OnLoadLibrarySucc:" }); if (www == null || www.assetBundle == null) { this.OnLoadLibraryError2(www); return; } LogSystem.LogWarning(new object[] { "OnLoadLibrarySucc:1" }); TextAsset textAsset = www.assetBundle.Load("GameLib") as TextAsset; if (textAsset == null) { this.muiGuide.ShowMBox(3, Config.GetUdpateLangage("LoadLibraryError"), new EventDelegate.Callback(this.LoadScriptLib), new EventDelegate.Callback(LaunchUtils.OnErrorQuit), string.Empty); return; } this.mRemoteAssembly = CoreLoader.LoadDllFile(textAsset.bytes); www.assetBundle.Unload(true); if (this.mRemoteAssembly == null) { this.muiGuide.ShowMBox(3, Config.GetUdpateLangage("LoadLibraryError"), new EventDelegate.Callback(this.LoadScriptLib), new EventDelegate.Callback(LaunchUtils.OnErrorQuit), string.Empty); return; } this.StartUpdater(); }
public static void Add(List <EventDelegate> list, EventDelegate.Callback callback, bool oneShot) { if (list != null) { int i = 0; int count = list.Count; while (i < count) { EventDelegate eventDelegate = list[i]; if (eventDelegate != null && eventDelegate.Equals(callback)) { return; } i++; } list.Add(new EventDelegate(callback) { oneShot = oneShot }); } else { LogSystem.LogWarning(new object[] { "Attempting to add a callback to a list that's null" }); } }
public static void Init() { LogSystem.LogWarning(new object[] { "current language version : ", Language.LanguageVersion.ToString() }); }
public void Execute() { LogSystem.LogWarning("执行结算命令"); RoomProxy.Instance.Settle(m_Room); DouDiZhuGameCtrl.Instance.OpenSettleView(m_Room); }
private void OnEnable() { LogSystem.LogWarning(new object[] { "OnEnable ->", base.gameObject.name }); }
public void GetChannelName() { LogSystem.LogWarning(new object[] { "GetChannelName" }); AndroidInterface.GetChannelName(); }
private void InitConfig() { if (this.guideui != null) { this.guideui.ShowInfo(Config.GetUdpateLangage("LoadConfig")); } Config.mbDynamicRes = true; TextAsset textAsset = Resources.Load("Local/Config/Version") as TextAsset; if (textAsset != null) { if (!string.IsNullOrEmpty(textAsset.text)) { string[] array = textAsset.text.Split(new char[] { '|' }); if (array.Length > 4) { Config.SetLocalVersion(array[0]); Config.SetLocalNumberVersion(array[1]); Config.SetVersionUseage(array[2]); Config.SetInstallationVersion(array[3]); } LogSystem.LogWarning(new object[] { "Version : ", textAsset.text }); } Resources.UnloadAsset(textAsset); } else { Config.SetLocalVersion(string.Empty); } TextAsset textAsset2 = Resources.Load("Local/Config/Login") as TextAsset; if (textAsset2 != null) { Config.SetUpdaterAddress(textAsset2); Resources.UnloadAsset(textAsset2); } TextAsset textAsset3 = Resources.Load("Local/Config/Language") as TextAsset; if (textAsset3 != null) { Config.SetLanguage(textAsset3.text); Resources.UnloadAsset(textAsset3); } TextAsset textAsset4 = Resources.Load("Local/Config/InitString") as TextAsset; if (textAsset4 != null) { Config.SetWordsInfo(textAsset4.text); Resources.UnloadAsset(textAsset4); } }
/// <summary> /// Helper function that checks to see if there are objects selected. /// </summary> static bool HasValidSelection() { if (Selection.objects == null || Selection.objects.Length == 0) { LogSystem.LogWarning("HasValidSelection You must select an object first"); return(false); } return(true); }
/// <summary> /// Check to ensure that the widget resides on the same layer as its panel. /// </summary> public void CheckLayer() { if (panel != null && panel.gameObject.layer != gameObject.layer) { LogSystem.LogWarning("You can't place widgets on a layer different than the UIPanel that manages them.\n", "If you want to move widgets to a different layer, parent them to a new panel instead.", this); gameObject.layer = panel.gameObject.layer; } }
/// <summary> /// Helper function that checks to see if there is an object with a Transform component selected. /// </summary> static bool HasValidTransform() { if (Selection.activeTransform == null) { LogSystem.LogWarning("HasValidTransform You must select an object first"); return(false); } return(true); }