U3D MonoBehaviour
一、简介
MonoBehaviour是每个脚本派生类的基类,它定义了一个脚本文件从最初被加载到最终被销毁的一个完整过程。
这个过程通过对应的方法体现出来,在不同的方法完成不同的功能,我们把这些方法称为:脚本生命周期相关的方法。包含内容有:
Awake():当该脚本实例被载入时Awake被调用。(只会被调用一次)
OnEable():当对象被启用并激活状态时此函数被调用。
Start():Start仅在当第一次脚本启用Update方法被调用之前调用。(只会被调用一次)
Update():当MonoBehaviour启用时,其Update在每一帧被调用
FixedUpdate():(固定更新)会按照设置的时间固定频率来循环更新
LateUpdate():LateUpdate是在所有Update函数调用后被调用。这可用于调整脚本执行顺序。例如:当物体在Update里移动时,跟随物体的相机可以在LateUpdate里实现。
OnGUI():渲染和处理GUI事件时调用。
OnDisable():当对象变为不可用或非激活状态时此函数被调用。
OnEnable():当对象被启用并激活状态时此函数被调用。
二、常用属性及方法介绍
Variables 变量
| useGUILayout | Disabling this lets you skip the GUI layout phase. 禁用此项,将会跳过GUILayout布局。 |
Functions 函数
| CancelInvoke | Cancels all Invoke calls on this MonoBehaviour. 在当前MonoBehaviour,取消所有Invoke调用 |
| Invoke | Invokes the method methodName in time seconds. 在time秒后,延迟调用方法methodName。 |
| InvokeRepeating | Invokes the method methodName in time seconds, then repeatedly every repeatRate seconds. 在time秒调用methodName方法,然后每repeatRate秒重复调用。 |
| IsInvoking | Is any invoke on methodName pending? methodName方法是否在等候调用? |
| StartCoroutine | Starts a coroutine. 开始协同程序。 |
| StopAllCoroutines | Stops all coroutines running on this behaviour. 停止运行此behaviour上的所有协同程序。 |
| StopCoroutine | Stops all coroutines named methodName running on this behaviour. 停止此behaviour上运行的所有名为methodName的协同程序。 |
Static Functions 静态函数
| Logs message to the Unity Console (identical to Debug.Log). 输出日志消息到Unity控制台。等同Debug.Log。 |
Messages 消息
| Awake | Awake is called when the script instance is being loaded. 当该脚本实例被载入时Awake被调用。 |
| FixedUpdate | This function is called every fixed framerate frame, if the MonoBehaviour is enabled. 当MonoBehaviour启用时,其 FixedUpdate 在每一帧被调用。 |
| LateUpdate | LateUpdate is called every frame, if the Behaviour is enabled. 当Behaviour启用时,其LateUpdate在每一帧被调用。 |
| OnAnimatorIK | Callback for setting up animation IK (inverse kinematics). 设置动画的IK回调(反向运动学)。 |
| OnAnimatorMove | Callback for processing animation movements for modifying root motion. 用于修改根运动处理动画移动的回调。 |
| OnApplicationFocus | Sent to all game objects when the player gets or loses focus. 当玩家获得或失去焦点时发送给所有游戏对象。 |
| OnApplicationPause | Sent to all game objects when the player pauses. 当玩家暂停发送给所有游戏对象。 |
| OnApplicationQuit | Sent to all game objects before the application is quit. 在应用退出之前发送给所有的游戏物体。 |
| OnAudioFilterRead | If OnAudioFilterRead is implemented, Unity will insert a custom filter into the audio DSP chain. 如果OnAudioFilterRead被执行,Unity将插入一个自定义的过滤器到音频DSP链。 |
| OnBecameInvisible | OnBecameInvisible is called when the renderer is no longer visible by any camera. 当renderer(渲染器)在任何相机上都不可见时调用OnBecameInvisible。 |
| OnBecameVisible | OnBecameVisible is called when the renderer became visible by any camera. 当renderer(渲染器)在任何相机上可见时调用OnBecameVisible。 |
| OnCollisionEnter | OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider. 当此collider/rigidbody触发另一个rigidbody/collider时,OnCollisionEnter将被调用。 |
| OnCollisionEnter2D | Sent when an incoming collider makes contact with this object's collider (2D physics only). 当进入的碰撞器与这个对象的碰撞器接触,发送信息(仅限2D物理)。 |
| OnCollisionExit | OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider. 当此collider/rigidbody停止触发另一个rigidbody/collider时,OnCollisionExit将被调用。 |
| OnCollisionExit2D | Sent when a collider on another object stops touching this object's collider (2D physics only). 当另一个对象的碰撞器停止接触这个对象的碰撞器时,发送信息(仅限2D物理)。 |
| OnCollisionStay | OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider. 当此collider/rigidbody触发另一个rigidbody/collider时,OnCollisionStay将会在每一帧被调用。 |
| OnCollisionStay2D | Sent each frame where a collider on another object is touching this object's collider (2D physics only). 当另一个对象的碰撞器每帧接触这个对象的碰撞器时,发送信息(仅限2D物理)。 |
| OnConnectedToServer | Called on the client when you have successfully connected to a server. 当成功连接到服务器时,在客户端调用。 |
| OnControllerColliderHit | OnControllerColliderHit is called when the controller hits a collider while performing a Move. 在移动的时,当controller碰撞到collider时OnControllerColliderHit被调用。 |
| OnDestroy | This function is called when the MonoBehaviour will be destroyed. 当MonoBehaviour将被销毁时,这个函数被调用。 |
| OnDisable | This function is called when the behaviour becomes disabled () or inactive. 当对象变为不可用或非激活状态时此函数被调用。 |
| OnDisconnectedFromServer | Called on the client when the connection was lost or you disconnected from the server. 当失去连接或从服务器端断开时在客户端调用。 |
| OnDrawGizmos | Implement OnDrawGizmos if you want to draw gizmos that are also pickable and always drawn. 如果你想绘制可被点选的gizmos,执行OnDrawGizmos。 |
| OnDrawGizmosSelected | Implement this OnDrawGizmosSelected if you want to draw gizmos only if the object is selected. 如果你想在物体被选中时绘制gizmos,执行这个函数。 |
| OnEnable | This function is called when the object becomes enabled and active. 当对象被启用并激活状态时此函数被调用。 |
| OnFailedToConnect | Called on the client when a connection attempt fails for some reason. 当一个连接因为某些原因失败时在客户端调用。 |
| OnFailedToConnectToMasterServer | Called on clients or servers when there is a problem connecting to the MasterServer. 当连接MasterServer出现问题时在客户端或服务器端调用。 |
| OnGUI | OnGUI is called for rendering and handling GUI events. 渲染和处理GUI事件时调用。 |
| OnJointBreak | Called when a joint attached to the same game object broke. 当附在同一对象上的关节被断开时调用。 |
| OnLevelWasLoaded | This function is called after a new level was loaded. 当一个新关卡被载入时此函数被调用。 |
| OnMasterServerEvent | Called on clients or servers when reporting events from the MasterServer. 当报告事件来自MasterServer时在客户端或服务器端调用。 |
| OnMouseDown | OnMouseDown is called when the user has pressed the mouse button while over the GUIElement or Collider. 当用户鼠标在GUIElement或Collider上点击时OnMouseDown被调用。 |
| OnMouseDrag | OnMouseDrag is called when the user has clicked on a GUIElement or Collider and is still holding down the mouse. 当用户鼠标在GUIElement或Collider上拖拽时OnMouseDrag被调用 。 |
| OnMouseEnter | OnMouseEnter is called when the mouse entered the GUIElement or Collider. 当鼠标进入到GUIElement(GUI元素)或Collider(碰撞体)中时调用OnMouseEnter。 |
| OnMouseExit | OnMouseExit is called when the mouse is not any longer over the GUIElement or Collider. 当用户鼠标不在GUIElement或Collider上时OnMouseExit被调用。 |
| OnMouseOver | OnMouseOver is called every frame while the mouse is over the GUIElement or Collider. 当用户鼠标在GUIElement或Collider上经过时OnMouseOver被调用。 |
| OnMouseUp | OnMouseUp is called when the user has released the mouse button. 当用户释放鼠标按钮时调用OnMouseUp。 |
| OnMouseUpAsButton | OnMouseUpAsButton is only called when the mouse is released over the same GUIElement or Collider as it was pressed. OnMouseUpAsButton只有当鼠标在同一个GUIElement或Collider按下,在释放时调用。 |
| OnNetworkInstantiate | Called on objects which have been network instantiated with Network.Instantiate. 当对象使用Network.Instantiate进行网络初始化时调用。 |
| OnParticleCollision | OnParticleCollision is called when a particle hits a collider. 当粒子碰到碰撞器时,OnParticleCollision 被调用。 |
| OnPlayerConnected | Called on the server whenever a new player has successfully connected. 当一个新玩家成功连接时在服务器上被调用。 |
| OnPlayerDisconnected | Called on the server whenever a player disconnected from the server. 当一个玩家从服务器上断开时在服务器端调用。 |
| OnPostRender | OnPostRender is called after a camera finished rendering the scene. 在相机完成场景渲染之后被调用。 |
| OnPreCull | OnPreCull is called before a camera culls the scene. 在相机消隐场景之前被调用。 |
| OnPreRender | OnPreRender is called before a camera starts rendering the scene. 在相机渲染场景之前被调用。 |
| OnRenderImage | OnRenderImage is called after all rendering is complete to render image. 当完成所有渲染图像后被调用,用来渲染图像后期效果。 |
| OnRenderObject | OnRenderObject is called after camera has rendered the scene. 在相机场景渲染完成后被调用。 |
| OnSerializeNetworkView | Used to customize synchronization of variables in a script watched by a network view. 在一个网络视图脚本中,用于自定义变量同步。 |
| OnServerInitialized | Called on the server whenever a Network.InitializeServer was invoked and has completed. 当Network.InitializeServer被调用并完成时,在服务器上调用这个函数。 |
| OnTriggerEnter | OnTriggerEnter is called when the Collider other enters the trigger. 当Collider(碰撞体)进入trigger(触发器)时调用OnTriggerEnter。 |
| OnTriggerEnter2D | Sent when another object enters a trigger collider attached to this object (2D physics only). 当另一个对象进入到这个对象附加的触发碰撞器时发送消息(仅2D物理)。 |
| OnTriggerExit | OnTriggerExit is called when the Collider other has stopped touching the trigger. 当Collider(碰撞体)停止触发trigger(触发器)时调用OnTriggerExit。 |
| OnTriggerExit2D | Sent when another object leaves a trigger collider attached to this object (2D physics only). 当另一个对象离开附加在这个对象的触发碰撞器时发送消息(仅2D物理)。 |
| OnTriggerStay | OnTriggerStay is called once per frame for every Collider other that is touching the trigger. 当碰撞体接触触发器时,OnTriggerStay将在每一帧被调用。 |
| OnTriggerStay2D | Sent each frame where another object is within a trigger collider attached to this object (2D physics only). 当另一个对象停留在这个对象附加的触发碰撞器内时,每帧发送消息(仅2D物理)。 |
| OnValidate | This function is called when the script is loaded or a value is changed in the inspector (Called in the editor only). 当该脚本被加载或检视面板的值被修改时,此函数被调用(仅在编辑器被调用)。 |
| OnWillRenderObject | OnWillRenderObject is called once for each camera if the object is visible. 如果该对象可见,OnWillRenderObject每次会被相机调用。 |
| Reset | Reset to default values. 重设为默认值。 |
| Start | Start is called on the frame when a script is enabled just before any of the Update methods is called the first time. Start仅在当第一次脚本启用Update方法被调用之前调用。 |
| Update | Update is called every frame, if the MonoBehaviour is enabled. 当MonoBehaviour启用时,其Update在每一帧被调用。 |
Variables 变量
| useGUILayout | Disabling this lets you skip the GUI layout phase. 禁用此项,将会跳过GUILayout布局。 |
Functions 函数
| CancelInvoke | Cancels all Invoke calls on this MonoBehaviour 在当前 MonoBehaviour,取消所有Invoke调用 |
| Invoke | Invokes the method methodName in time seconds. 在time秒后,延迟调用方法methodName。 |
| InvokeRepeating | Invokes the method methodName in time seconds, then repeatedly every repeatRate seconds. 在time秒调用methodName方法,然后每repeatRate秒重复调用。 |
| IsInvoking | Is any invoke on methodName pending? methodName方法是否在等候调用? |
| StartCoroutine | Starts a coroutine. 开始协同程序。 |
| StopAllCoroutines | Stops all coroutines running on this behaviour. 停止运行此behaviour上的所有协同程序。 |
| StopCoroutine | Stops all coroutines named methodName running on this behaviour. 停止此behaviour上运行的所有名为methodName的协同程序。 |
Static Functions 静态函数
| Logs message to the Unity Console (identical to Debug.Log). 输出日志消息到Unity控制台。等同Debug.Log。 |
Messages 消息
| Awake | Awake is called when the script instance is being loaded. 当该脚本实例被载入时Awake被调用。 |
| FixedUpdate | This function is called every fixed framerate frame, if the MonoBehaviour is enabled. 当 MonoBehaviour启用时,其 FixedUpdate 在每一帧被调用。 |
| LateUpdate | LateUpdate is called every frame, if the Behaviour is enabled. 当Behaviour启用时,其LateUpdate在每一帧被调用。 |
| OnAnimatorIK | Callback for setting up animation IK (inverse kinematics). 设置动画的IK回调(反向运动学)。 |
| OnAnimatorMove | Callback for processing animation movements for modifying root motion. 用于修改根运动处理动画移动的回调。 |
| OnApplicationFocus | Sent to all game objects when the player gets or loses focus. 当玩家获得或失去焦点时发送给所有游戏对象。 |
| OnApplicationPause | Sent to all game objects when the player pauses. 当玩家暂停发送给所有游戏对象。 |
| OnApplicationQuit | Sent to all game objects before the application is quit. 在应用退出之前发送给所有的游戏物体。 |
| OnAudioFilterRead | If OnAudioFilterRead is implemented, Unity will insert a custom filter into the audio DSP chain. 如果OnAudioFilterRead被执行,Unity将插入一个自定义的过滤器到音频DSP链。 |
| OnBecameInvisible | OnBecameInvisible is called when the renderer is no longer visible by any camera. 当renderer(渲染器)在任何相机上都不可见时调用OnBecameInvisible。 |
| OnBecameVisible | OnBecameVisible is called when the renderer became visible by any camera. 当renderer(渲染器)在任何相机上可见时调用OnBecameVisible。 |
| OnCollisionEnter | OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider. 当此collider/rigidbody触发另一个rigidbody/collider时,OnCollisionEnter将被调用。 |
| OnCollisionEnter2D | Sent when an incoming collider makes contact with this object's collider (2D physics only). 当进入的碰撞器与这个对象的碰撞器接触,发送信息(仅限2D物理)。 |
| OnCollisionExit | OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider. 当此collider/rigidbody停止触发另一个rigidbody/collider时,OnCollisionExit将被调用。 |
| OnCollisionExit2D | Sent when a collider on another object stops touching this object's collider (2D physics only). 当另一个对象的碰撞器停止接触这个对象的碰撞器时,发送信息(仅限2D物理)。 |
| OnCollisionStay | OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider. 当此collider/rigidbody触发另一个rigidbody/collider时,OnCollisionStay将会在每一帧被调用。 |
| OnCollisionStay2D | Sent each frame where a collider on another object is touching this object's collider (2D physics only). 当另一个对象的碰撞器每帧接触这个对象的碰撞器时,发送信息(仅限2D物理)。 |
| OnConnectedToServer | Called on the client when you have successfully connected to a server. 当成功连接到服务器时,在客户端调用。 |
| OnControllerColliderHit | OnControllerColliderHit is called when the controller hits a collider while performing a Move. 在移动的时,当controller碰撞到collider时OnControllerColliderHit被调用。 |
| OnDestroy | This function is called when the MonoBehaviour will be destroyed. 当 MonoBehaviour将被销毁时,这个函数被调用。 |
| OnDisable | This function is called when the behaviour becomes disabled () or inactive. 当对象变为不可用或非激活状态时此函数被调用。 |
| OnDisconnectedFromServer | Called on the client when the connection was lost or you disconnected from the server. 当失去连接或从服务器端断开时在客户端调用。 |
| OnDrawGizmos | Implement OnDrawGizmos if you want to draw gizmos that are also pickable and always drawn. 如果你想绘制可被点选的gizmos,执行OnDrawGizmos。 |
| OnDrawGizmosSelected | Implement this OnDrawGizmosSelected if you want to draw gizmos only if the object is selected. 如果你想在物体被选中时绘制gizmos,执行这个函数。 |
| OnEnable | This function is called when the object becomes enabled and active. 当对象被启用并激活状态时此函数被调用。 |
| OnFailedToConnect | Called on the client when a connection attempt fails for some reason. 当一个连接因为某些原因失败时在客户端调用。 |
| OnFailedToConnectToMasterServer | Called on clients or servers when there is a problem connecting to the MasterServer. 当连接MasterServer出现问题时在客户端或服务器端调用。 |
| OnGUI | OnGUI is called for rendering and handling GUI events. 渲染和处理GUI事件时调用。 |
| OnJointBreak | Called when a joint attached to the same game object broke. 当附在同一对象上的关节被断开时调用。 |
| OnLevelWasLoaded | This function is called after a new level was loaded. 当一个新关卡被载入时此函数被调用。 |
| OnMasterServerEvent | Called on clients or servers when reporting events from the MasterServer. 当报告事件来自MasterServer时在客户端或服务器端调用。 |
| OnMouseDown | OnMouseDown is called when the user has pressed the mouse button while over the GUIElement or Collider. 当用户鼠标在GUIElement或Collider上点击时OnMouseDown被调用。 |
| OnMouseDrag | OnMouseDrag is called when the user has clicked on a GUIElement or Collider and is still holding down the mouse. 当用户鼠标在GUIElement或Collider上拖拽时OnMouseDrag被调用 。 |
| OnMouseEnter | OnMouseEnter is called when the mouse entered the GUIElement or Collider. 当鼠标进入到GUIElement(GUI元素)或Collider(碰撞体)中时调用OnMouseEnter。 |
| OnMouseExit | OnMouseExit is called when the mouse is not any longer over the GUIElement or Collider. 当用户鼠标不在GUIElement或Collider上时OnMouseExit被调用。 |
| OnMouseOver | OnMouseOver is called every frame while the mouse is over the GUIElement or Collider. 当用户鼠标在GUIElement或Collider上经过时OnMouseOver被调用。 |
| OnMouseUp | OnMouseUp is called when the user has released the mouse button. 当用户释放鼠标按钮时调用OnMouseUp。 |
| OnMouseUpAsButton | OnMouseUpAsButton is only called when the mouse is released over the same GUIElement or Collider as it was pressed. OnMouseUpAsButton只有当鼠标在同一个GUIElement或Collider按下,在释放时调用。 |
| OnNetworkInstantiate | Called on objects which have been network instantiated with Network.Instantiate. 当对象使用Network.Instantiate进行网络初始化时调用。 |
| OnParticleCollision | OnParticleCollision is called when a particle hits a collider. 当粒子碰到碰撞器时,OnParticleCollision 被调用。 |
| OnPlayerConnected | Called on the server whenever a new player has successfully connected. 当一个新玩家成功连接时在服务器上被调用。 |
| OnPlayerDisconnected | Called on the server whenever a player disconnected from the server. 当一个玩家从服务器上断开时在服务器端调用。 |
| OnPostRender | OnPostRender is called after a camera finished rendering the scene. 在相机完成场景渲染之后被调用。 |
| OnPreCull | OnPreCull is called before a camera culls the scene. 在相机消隐场景之前被调用。 |
| OnPreRender | OnPreRender is called before a camera starts rendering the scene. 在相机渲染场景之前被调用。 |
| OnRenderImage | OnRenderImage is called after all rendering is complete to render image. 当完成所有渲染图像后被调用,用来渲染图像后期效果。 |
| OnRenderObject | OnRenderObject is called after camera has rendered the scene. 在相机场景渲染完成后被调用。 |
| OnSerializeNetworkView | Used to customize synchronization of variables in a script watched by a network view. 在一个网络视图脚本中,用于自定义变量同步。 |
| OnServerInitialized | Called on the server whenever a Network.InitializeServer was invoked and has completed. 当Network.InitializeServer被调用并完成时,在服务器上调用这个函数。 |
| OnTriggerEnter | OnTriggerEnter is called when the Collider other enters the trigger. 当Collider(碰撞体)进入trigger(触发器)时调用OnTriggerEnter。 |
| OnTriggerEnter2D | Sent when another object enters a trigger collider attached to this object (2D physics only). 当另一个对象进入到这个对象附加的触发碰撞器时发送消息(仅2D物理)。 |
| OnTriggerExit | OnTriggerExit is called when the Collider other has stopped touching the trigger. 当Collider(碰撞体)停止触发trigger(触发器)时调用OnTriggerExit。 |
| OnTriggerExit2D | Sent when another object leaves a trigger collider attached to this object (2D physics only). 当另一个对象离开附加在这个对象的触发碰撞器时发送消息(仅2D物理)。 |
| OnTriggerStay | OnTriggerStay is called once per frame for every Collider other that is touching the trigger. 当碰撞体接触触发器时,OnTriggerStay将在每一帧被调用。 |
| OnTriggerStay2D | Sent each frame where another object is within a trigger collider attached to this object (2D physics only). 当另一个对象停留在这个对象附加的触发碰撞器内时,每帧发送消息(仅2D物理)。 |
| OnValidate | This function is called when the script is loaded or a value is changed in the inspector (Called in the editor only). 当该脚本被加载或检视面板的值被修改时,此函数被调用(仅在编辑器被调用)。 |
| OnWillRenderObject | OnWillRenderObject is called once for each camera if the object is visible. 如果该对象可见,OnWillRenderObject每次会被相机调用。 |
| Reset | Reset to default values. 重设为默认值。 |
| Start | Start is called on the frame when a script is enabled just before any of the Update methods is called the first time. Start仅在当第一次脚本启用Update方法被调用之前调用。 |
| Update | Update is called every frame, if the MonoBehaviour is enabled. 当 MonoBehaviour启用时,其Update在每一帧被调用。 |
U3D MonoBehaviour的更多相关文章
- U3D笔记11:47 2016/11/30-15:15 2016/12/19
11:47 2016/11/30Before you can load a level you have to add it to the list of levels used in the gam ...
- 尝试u3d中将代码与编辑器分离
最近与朋友交流,他一直是做端游,最近接触了u3d以后无法忍受代码与配置文件,美术资源全部纠缠在一起的状况,于是一直在琢磨怎么将编辑器与代码彻底分离. 自己也抽空研究一下,碰到一些问题先记录下来. 首先 ...
- U3D杂记
1,点击UI上的登录按钮,从脚本发出ioo.netmanager.SendConnet->进入CS->soketclient.sendconnet...->netmanager调用 ...
- U3D 动画帧事件问题
测试版本U3D5.4. 1,为一个模型导入外部动画.为动画剪辑attack在某帧添加event,事件为 public void OnAttackEvent(){},函数体不做任何事情. 结果发现,在动 ...
- 全景视频外包团队:U3D全景漫游(二)
单击Ambient Light,如下 调整为 即可设置完成 14.设置第一人称浏览 删除场景中Main Camera 将Project区域的Standard Assets下的Prefabs下的Firs ...
- u3d动态加入模型
楼层一层一层的加,把模型分开,弄成prefab放到Resourse文件夹里,在代码里用Instantiate(Resources.Load("模型名字") as GameObjec ...
- U3D自定义Inspector项未触发保存事件的解决方案
1.问题描述与解决方案 1.1.说明 应该只有起步做U3D编辑器插件的部分同行需要了解本文. 该问题源于在做UI插件的时候,发现Inspector面板上手动修改值后,没有触发U3D编辑器本身的修改事件 ...
- U3D Debug.log的问题
今天在测试有yield有关的问题时,发现Debug.log()是异步输出机制.不一定会在调用后立即执行. 在C++有类似问题:std::cout 也不一定会立即输出,加上"\n"或 ...
- U3D 飞机大战(MVC模式)解析--面向对象编程思想
在自己研究U3D游戏的时候,看过一些人的简单的游戏开发视频,写的不错,只是个人是java web 开发的人,所以结合着MVC思想,对游戏开发进行了一番考虑. 如果能把游戏更加的思想化,分工化,开发便明 ...
随机推荐
- vector容器用法详解
vector类称作向量类,它实现了动态数组,用于元素数量变化的对象数组.像数组一样,vector类也用从0开始的下标表示元素的位置:但和数组不同的是,当vector对象创建后,数组的元素个数会随着ve ...
- session和cookie相关知识总结
HTTP协议本身是无状态的,这与HTTP协议本来的目的是相符的,客户端只需要简单的向服务器请求下载某些文件,无论是客户端还是服务器都没有必要纪录彼此过去的行为,每一次请求之间都是独立的. 人们很快发现 ...
- ABP框架系列之三十五:(MVC-Controllers-MVC控制器)
Introduction ASP.NET Boilerplate is integrated to ASP.NET MVC Controllers via Abp.Web.Mvc nuget pack ...
- shell脚本基础教程
一.什么是shell: shell解释:引用别人的话说:“Shell 是一个用 C 语言编写的程序,它是用户使用 Linux 的桥梁.Shell 既是一种命令语言,又是一种程序设计语言.” 简而言之, ...
- 去除swagger ui的红色 error 错误提示
去除swagger ui的红色 error 错误提示 自定义js文件中加入以下的代码. 加入自定义的js方法看这里 http://www.cnblogs.com/wang2650/archive/20 ...
- 4.ASP.NET MVC 5.0 视图之模型绑定
大家好,这篇文章,我将向大家介绍ASP.NET MVC的模型视图绑定,ASP.MVC的模型绑定分为两种:一种是动态绑定[Dynamic Binding];还有一种就是强类型绑定[Strongly ty ...
- Java中的Lock接口
Synchronized & Lock synchronized 是Java语言中的关键字,由monitorenter,monitorexit两个指令实现.JVM会将monitorenter指 ...
- Redis 分布式锁进化史(解读 + 缺陷分析)
Redis分布式锁进化史 近两年来微服务变得越来越热门,越来越多的应用部署在分布式环境中,在分布式环境中,数据一致性是一直以来需要关注并且去解决的问题,分布式锁也就成为了一种广泛使用的技术,常用的分布 ...
- postgresql-无序uuid tps测试
# postgresql-无序uuid tps测试 ## 无序uuid对数据库的影响 由于最近在做超大表的性能测试,在该过程中发现了无序uuid做主键对表插入性能有一定影响.结合实际情况发现当表的数据 ...
- mongodb3.x主从配置及备份
本文将介绍下mongodb主从配置及备份 MongoDB 是一个基于分布式文件存储的数据库.由 C++ 语言编写.旨在为 WEB 应用提供可扩展的高性能数据存储解决方案. MongoDB 是一个介于关 ...