效果:点击白色框可拖拽选择区域

代码:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems; public class jietu : MonoBehaviour, IDragHandler, IEndDragHandler,IBeginDragHandler
{
void Start()
{
//DrawTriangle(30, 0, 100, 250, 200, 100, mat);//三角形的三个定点坐标
} public void OnBeginDrag(PointerEventData eventData)
{
dragObj = eventData.rawPointerPress;
} public void OnDrag(PointerEventData eventData)
{
if (dragObj!=null)
{
dragObj.transform.position = Input.mousePosition; leftBottomPos = leftBottom.transform.position;
leftTopPos = leftTop.transform.position;
rightTopPos = rightTop.transform.position;
rightBottomPos = rightBottom.transform.position; if (dragObj.Equals(leftBottom))
{
leftTopPos.x = dragObj.transform.position.x;
rightBottomPos.y= dragObj.transform.position.y;
leftTop.transform.position = leftTopPos;
rightBottom.transform.position = rightBottomPos;
}
else if (dragObj.Equals(leftTop))
{
leftBottomPos.x = dragObj.transform.position.x;
rightTopPos.y = dragObj.transform.position.y;
leftBottom.transform.position = leftBottomPos;
rightTop.transform.position = rightTopPos;
}
else if (dragObj.Equals(rightTop))
{
rightBottomPos.x = dragObj.transform.position.x;
leftTopPos.y = dragObj.transform.position.y;
rightBottom.transform.position = rightBottomPos;
leftTop.transform.position = leftTopPos;
}
else if (dragObj.Equals(rightBottom))
{
rightTopPos.x = dragObj.transform.position.x;
leftBottomPos.y = dragObj.transform.position.y;
rightTop.transform.position = rightTopPos;
leftBottom.transform.position = leftBottomPos;
}
} } public void OnEndDrag(PointerEventData eventData)
{
dragObj = null;
} GameObject dragObj; public GameObject leftBottom;
public GameObject leftTop;
public GameObject rightTop;
public GameObject rightBottom; Vector2 leftBottomPos = Vector2.zero;
Vector2 leftTopPos = Vector2.zero;
Vector2 rightTopPos = Vector2.zero;
Vector2 rightBottomPos = Vector2.zero; public Material mat;
void OnRenderObject()
{
DrawTriangle();//三角形的三个定点坐标
    }
void DrawTriangle()
{
GL.PushMatrix();
mat.SetPass(0);
GL.LoadOrtho();
GL.Begin(GL.QUADS);//顺时针方向 //顶部
GL.Vertex3(leftTop.transform.position.x / Screen.width, leftTop.transform.position.y / Screen.height, 0);
GL.Vertex3(0, 1, 0);
GL.Vertex3(1, 1, 0);
GL.Vertex3(rightTop.transform.position.x / Screen.width, rightTop.transform.position.y / Screen.height, 0); //右侧
GL.Vertex3(rightBottom.transform.position.x / Screen.width, rightBottom.transform.position.y / Screen.height, 0);
GL.Vertex3(rightTop.transform.position.x / Screen.width, rightTop.transform.position.y / Screen.height, 0);
GL.Vertex3(1, 1, 0);
GL.Vertex3(1, 0, 0); //底部
GL.Vertex3(0, 0, 0);//屏幕左下角
GL.Vertex3(leftBottom.transform.position.x / Screen.width, leftBottom.transform.position.y / Screen.height, 0);//屏幕左上角
GL.Vertex3(rightBottom.transform.position.x / Screen.width, rightBottom.transform.position.y / Screen.height, 0);//屏幕右上角
GL.Vertex3(1, 0, 0);//屏幕右下角 //左侧
GL.Vertex3(0, 0, 0);
GL.Vertex3(0, 1, 0);
GL.Vertex3(leftTop.transform.position.x / Screen.width, leftTop.transform.position.y / Screen.height, 0);
GL.Vertex3(leftBottom.transform.position.x / Screen.width, leftBottom.transform.position.y / Screen.height, 0); GL.End();
GL.PopMatrix();
}
}

  

unity里的设置

改良版:限定剪裁区域的最小范围

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems; public class jietu : MonoBehaviour, IDragHandler, IEndDragHandler, IBeginDragHandler
{
GameObject dragObj; public GameObject leftBottom;
public GameObject leftTop;
public GameObject rightTop;
public GameObject rightBottom; Vector2 leftBottomPos;
Vector2 leftTopPos;
Vector2 rightTopPos;
Vector2 rightBottomPos; public Material mat; public float x_min = 100;
public float y_min = 100; public void OnBeginDrag(PointerEventData eventData)
{
dragObj = eventData.rawPointerPress;
leftBottomPos = leftBottom.transform.position;
leftTopPos = leftTop.transform.position;
rightTopPos = rightTop.transform.position;
rightBottomPos = rightBottom.transform.position;
} public void OnDrag(PointerEventData eventData)
{
if (dragObj != null)
{
if (dragObj.Equals(leftBottom))
{
if ((rightTopPos.x - Input.mousePosition.x) > x_min)
{
leftBottomPos.x = Input.mousePosition.x;
leftTopPos.x = Input.mousePosition.x; leftBottom.transform.position = leftBottomPos;
leftTop.transform.position = leftTopPos;
} if ((rightTopPos.y - Input.mousePosition.y) > y_min)
{
leftBottomPos.y = Input.mousePosition.y;
rightBottomPos.y = Input.mousePosition.y; leftBottom.transform.position = leftBottomPos;
rightBottom.transform.position = rightBottomPos;
} }
else if (dragObj.Equals(leftTop))
{
if ((rightBottomPos.x - Input.mousePosition.x) > x_min)
{
leftTopPos.x = Input.mousePosition.x;
leftBottomPos.x = Input.mousePosition.x; leftTop.transform.position = leftTopPos;
leftBottom.transform.position = leftBottomPos; }
if ((Input.mousePosition.y - rightBottomPos.y) > y_min)
{
leftTopPos.y = Input.mousePosition.y;
rightTopPos.y = Input.mousePosition.y; leftTop.transform.position = leftTopPos;
rightTop.transform.position = rightTopPos;
}
}
else if (dragObj.Equals(rightTop))
{
if ((Input.mousePosition.x - leftBottomPos.x) > x_min)
{
rightTopPos.x = Input.mousePosition.x;
rightBottomPos.x = Input.mousePosition.x; rightTop.transform.position = rightTopPos;
rightBottom.transform.position = rightBottomPos;
}
if ((Input.mousePosition.y - leftBottomPos.y) > y_min)
{
rightTopPos.y = Input.mousePosition.y;
leftTopPos.y = Input.mousePosition.y; rightTop.transform.position = rightTopPos;
leftTop.transform.position = leftTopPos;
}
}
else if (dragObj.Equals(rightBottom))
{
if ((Input.mousePosition.x - leftTopPos.x) > x_min)
{
rightBottomPos.x = Input.mousePosition.x;
rightTopPos.x = Input.mousePosition.x; rightBottom.transform.position = rightBottomPos;
rightTop.transform.position = rightTopPos;
}
if ((leftTopPos.y - Input.mousePosition.y) > y_min)
{
rightBottomPos.y = Input.mousePosition.y;
leftBottomPos.y = Input.mousePosition.y; rightBottom.transform.position = rightBottomPos;
leftBottom.transform.position = leftBottomPos;
}
}
}
} public void OnEndDrag(PointerEventData eventData)
{
dragObj = null;
} void OnRenderObject()
{
DrawTriangle();//三角形的三个定点坐标
    }
void DrawTriangle()
{
GL.PushMatrix();
mat.SetPass(0);
GL.LoadOrtho();
GL.Begin(GL.QUADS);//顺时针方向 //顶部
GL.Vertex3(leftTop.transform.position.x / Screen.width, leftTop.transform.position.y / Screen.height, 0);
GL.Vertex3(0, 1, 0);
GL.Vertex3(1, 1, 0);
GL.Vertex3(rightTop.transform.position.x / Screen.width, rightTop.transform.position.y / Screen.height, 0); //右侧
GL.Vertex3(rightBottom.transform.position.x / Screen.width, rightBottom.transform.position.y / Screen.height, 0);
GL.Vertex3(rightTop.transform.position.x / Screen.width, rightTop.transform.position.y / Screen.height, 0);
GL.Vertex3(1, 1, 0);
GL.Vertex3(1, 0, 0); //底部
GL.Vertex3(0, 0, 0);//屏幕左下角
GL.Vertex3(leftBottom.transform.position.x / Screen.width, leftBottom.transform.position.y / Screen.height, 0);//屏幕左上角
GL.Vertex3(rightBottom.transform.position.x / Screen.width, rightBottom.transform.position.y / Screen.height, 0);//屏幕右上角
GL.Vertex3(1, 0, 0);//屏幕右下角 //左侧
GL.Vertex3(0, 0, 0);
GL.Vertex3(0, 1, 0);
GL.Vertex3(leftTop.transform.position.x / Screen.width, leftTop.transform.position.y / Screen.height, 0);
GL.Vertex3(leftBottom.transform.position.x / Screen.width, leftBottom.transform.position.y / Screen.height, 0); GL.End();
GL.PopMatrix();
} }

  

在实际使用的时候发现用GL画的图像,会导致无法适应UGUI的层级关系,永远位于UI的下层或者上层(取决于Canvas的Render mode),

下面是改良版本,完美适应UI的层级关系

代码如下:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Serialization;
using UnityEngine.UI; public class LineChart : MaskableGraphic, IDragHandler, IEndDragHandler, IBeginDragHandler
{ protected override void OnPopulateMesh(VertexHelper vh)
{
vh.Clear(); UIVertex[] verts0 = new UIVertex[4]; //顶部
verts0[0]=SetVertexs(verts0[0], leftTop.transform.localPosition);
verts0[1]=SetVertexs(verts0[1], screen_leftTopPos);
verts0[2]=SetVertexs(verts0[2], screen_rightTopPos);
verts0[3] = SetVertexs(verts0[3], rightTop.transform.localPosition); vh.AddUIVertexQuad(verts0); UIVertex[] verts1 = new UIVertex[4];
//右侧
verts1[0] = SetVertexs(verts1[0], rightBottom.transform.localPosition);
verts1[1] = SetVertexs(verts1[1], rightTop.transform.localPosition);
verts1[2] = SetVertexs(verts1[2], screen_rightTopPos);
verts1[3] = SetVertexs(verts1[3], screen_rightBottomPos);
vh.AddUIVertexQuad(verts1); //底部
UIVertex[] verts2 = new UIVertex[4];
verts2[0] = SetVertexs(verts2[0], screen_leftBottomPos);//屏幕左下角
verts2[1] = SetVertexs(verts2[1], leftBottom.transform.localPosition);//屏幕左上角
verts2[2] = SetVertexs(verts2[2], rightBottom.transform.localPosition);//屏幕右上角
verts2[3] = SetVertexs(verts2[3], screen_rightBottomPos);//屏幕右下角
vh.AddUIVertexQuad(verts2); //左侧
UIVertex[] verts3 = new UIVertex[4];
verts3[0] = SetVertexs(verts3[0], screen_leftBottomPos);
verts3[1] = SetVertexs(verts3[1], screen_leftTopPos);
verts3[2] = SetVertexs(verts3[2], leftTop.transform.localPosition);
verts3[3] = SetVertexs(verts3[3], leftBottom.transform.localPosition);
vh.AddUIVertexQuad(verts3);
} GameObject dragObj; public GameObject leftBottom;
public GameObject leftTop;
public GameObject rightTop;
public GameObject rightBottom; Vector2 leftBottomPos;
Vector2 leftTopPos;
Vector2 rightTopPos;
Vector2 rightBottomPos; public float x_min = 100;
public float y_min = 100; readonly Vector2 screen_leftBottomPos= new Vector3(-Screen.width * 0.5f, -Screen.height * 0.5f);
readonly Vector2 screen_leftTopPos= new Vector3(-Screen.width * 0.5f, Screen.height * 0.5f);
readonly Vector2 screen_rightTopPos= new Vector3(Screen.width * 0.5f, Screen.height * 0.5f);
readonly Vector2 screen_rightBottomPos= new Vector3(Screen.width * 0.5f, -Screen.height * 0.5f); public void OnBeginDrag(PointerEventData eventData)
{
dragObj = eventData.rawPointerPress;
leftBottomPos = leftBottom.transform.localPosition;
leftTopPos = leftTop.transform.localPosition;
rightTopPos = rightTop.transform.localPosition;
rightBottomPos = rightBottom.transform.localPosition;
} public void OnDrag(PointerEventData eventData)
{
if (dragObj != null)
{
float x = Input.mousePosition.x - Screen.width * 0.5f;
float y = Input.mousePosition.y - Screen.height * 0.5f;
if (dragObj.Equals(leftBottom))
{
if ((rightTopPos.x - x) > x_min)
{
leftBottomPos.x = x;
leftTopPos.x = x; leftBottom.transform.localPosition = leftBottomPos;
leftTop.transform.localPosition = leftTopPos;
} if ((rightTopPos.y - y) > y_min)
{
leftBottomPos.y = y;
rightBottomPos.y = y; leftBottom.transform.localPosition = leftBottomPos;
rightBottom.transform.localPosition = rightBottomPos;
} }
else if (dragObj.Equals(leftTop))
{
if ((rightBottomPos.x - x) > x_min)
{
leftTopPos.x = x;
leftBottomPos.x = x; leftTop.transform.localPosition = leftTopPos;
leftBottom.transform.localPosition = leftBottomPos; }
if ((y - rightBottomPos.y) > y_min)
{
leftTopPos.y = y;
rightTopPos.y = y; leftTop.transform.localPosition = leftTopPos;
rightTop.transform.localPosition = rightTopPos;
}
}
else if (dragObj.Equals(rightTop))
{
if ((x - leftBottomPos.x) > x_min)
{
rightTopPos.x = x;
rightBottomPos.x = x; rightTop.transform.localPosition = rightTopPos;
rightBottom.transform.localPosition = rightBottomPos;
}
if ((y - leftBottomPos.y) > y_min)
{
rightTopPos.y = y;
leftTopPos.y = y; rightTop.transform.localPosition = rightTopPos;
leftTop.transform.localPosition = leftTopPos;
}
}
else if (dragObj.Equals(rightBottom))
{
if ((x - leftTopPos.x) > x_min)
{
rightBottomPos.x = x;
rightTopPos.x = x; rightBottom.transform.localPosition = rightBottomPos;
rightTop.transform.localPosition = rightTopPos;
}
if ((leftTopPos.y - y) > y_min)
{
rightBottomPos.y = y;
leftBottomPos.y = y; rightBottom.transform.localPosition = rightBottomPos;
leftBottom.transform.localPosition = leftBottomPos;
}
}
} UpdateGeometry();
} public void OnEndDrag(PointerEventData eventData)
{
dragObj = null;
} UIVertex SetVertexs(UIVertex vertex, Vector2 vertexPos)
{
vertex.position = vertexPos;
vertex.color = color;//color是父类中的属性
vertex.uv0 = Vector2.zero;
return vertex;
} }

  

最终版本:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI; public class LineChart : Graphic, IDragHandler, IEndDragHandler, IBeginDragHandler
{
protected override void OnPopulateMesh(VertexHelper vh)
{
vh.Clear(); //顶部
verts0[0]=SetVertexs(verts0[0], leftTop.transform.localPosition);
verts0[1]=SetVertexs(verts0[1], screen_leftTopPos);
verts0[2]=SetVertexs(verts0[2], screen_rightTopPos);
verts0[3] = SetVertexs(verts0[3], rightTop.transform.localPosition);
vh.AddUIVertexQuad(verts0); //右侧
verts1[0] = SetVertexs(verts1[0], rightBottom.transform.localPosition);
verts1[1] = SetVertexs(verts1[1], rightTop.transform.localPosition);
verts1[2] = SetVertexs(verts1[2], screen_rightTopPos);
verts1[3] = SetVertexs(verts1[3], screen_rightBottomPos);
vh.AddUIVertexQuad(verts1); //底部
verts2[0] = SetVertexs(verts2[0], screen_leftBottomPos);//屏幕左下角
verts2[1] = SetVertexs(verts2[1], leftBottom.transform.localPosition);//屏幕左上角
verts2[2] = SetVertexs(verts2[2], rightBottom.transform.localPosition);//屏幕右上角
verts2[3] = SetVertexs(verts2[3], screen_rightBottomPos);//屏幕右下角
vh.AddUIVertexQuad(verts2); //左侧
verts3[0] = SetVertexs(verts3[0], screen_leftBottomPos);
verts3[1] = SetVertexs(verts3[1], screen_leftTopPos);
verts3[2] = SetVertexs(verts3[2], leftTop.transform.localPosition);
verts3[3] = SetVertexs(verts3[3], leftBottom.transform.localPosition);
vh.AddUIVertexQuad(verts3);
} public GameObject leftBottom;
public GameObject leftTop;
public GameObject rightTop;
public GameObject rightBottom; public float x_min = 100;
public float y_min = 100; GameObject dragObj; Vector2 leftBottomPos;
Vector2 leftTopPos;
Vector2 rightTopPos;
Vector2 rightBottomPos; readonly UIVertex[] verts0 = new UIVertex[4];
readonly UIVertex[] verts1 = new UIVertex[4];
readonly UIVertex[] verts2 = new UIVertex[4];
readonly UIVertex[] verts3 = new UIVertex[4]; readonly Vector2 screen_leftBottomPos= new Vector3(-Screen.width * 0.5f, -Screen.height * 0.5f);
readonly Vector2 screen_leftTopPos= new Vector3(-Screen.width * 0.5f, Screen.height * 0.5f);
readonly Vector2 screen_rightTopPos= new Vector3(Screen.width * 0.5f, Screen.height * 0.5f);
readonly Vector2 screen_rightBottomPos= new Vector3(Screen.width * 0.5f, -Screen.height * 0.5f); public void OnBeginDrag(PointerEventData eventData)
{
dragObj = eventData.rawPointerPress;
leftBottomPos = leftBottom.transform.localPosition;
leftTopPos = leftTop.transform.localPosition;
rightTopPos = rightTop.transform.localPosition;
rightBottomPos = rightBottom.transform.localPosition;
} public void OnDrag(PointerEventData eventData)
{
if (dragObj != null)
{
float x = Input.mousePosition.x - Screen.width * 0.5f;
float y = Input.mousePosition.y - Screen.height * 0.5f;
if (dragObj.Equals(leftBottom))
{
if ((rightTopPos.x - x) > x_min)
{
leftBottomPos.x = x;
leftTopPos.x = x; leftBottom.transform.localPosition = leftBottomPos;
leftTop.transform.localPosition = leftTopPos;
}
if ((rightTopPos.y - y) > y_min)
{
leftBottomPos.y = y;
rightBottomPos.y = y; leftBottom.transform.localPosition = leftBottomPos;
rightBottom.transform.localPosition = rightBottomPos;
}
}
else if (dragObj.Equals(leftTop))
{
if ((rightBottomPos.x - x) > x_min)
{
leftTopPos.x = x;
leftBottomPos.x = x; leftTop.transform.localPosition = leftTopPos;
leftBottom.transform.localPosition = leftBottomPos; }
if ((y - rightBottomPos.y) > y_min)
{
leftTopPos.y = y;
rightTopPos.y = y; leftTop.transform.localPosition = leftTopPos;
rightTop.transform.localPosition = rightTopPos;
}
}
else if (dragObj.Equals(rightTop))
{
if ((x - leftBottomPos.x) > x_min)
{
rightTopPos.x = x;
rightBottomPos.x = x; rightTop.transform.localPosition = rightTopPos;
rightBottom.transform.localPosition = rightBottomPos;
}
if ((y - leftBottomPos.y) > y_min)
{
rightTopPos.y = y;
leftTopPos.y = y; rightTop.transform.localPosition = rightTopPos;
leftTop.transform.localPosition = leftTopPos;
}
}
else if (dragObj.Equals(rightBottom))
{
if ((x - leftTopPos.x) > x_min)
{
rightBottomPos.x = x;
rightTopPos.x = x; rightBottom.transform.localPosition = rightBottomPos;
rightTop.transform.localPosition = rightTopPos;
}
if ((leftTopPos.y - y) > y_min)
{
rightBottomPos.y = y;
leftBottomPos.y = y; rightBottom.transform.localPosition = rightBottomPos;
leftBottom.transform.localPosition = leftBottomPos;
}
}
}
UpdateGeometry();
} public void OnEndDrag(PointerEventData eventData)
{
dragObj = null;
} UIVertex SetVertexs(UIVertex vertex, Vector2 vertexPos)
{
vertex.position = vertexPos;
vertex.color = color;//color是父类中的属性
vertex.uv0 = Vector2.zero;
return vertex;
}
}

  

Unity 截图选择框,中间全透明,边缘半透明的更多相关文章

  1. s2选择框的全选和反选jQuery

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. 纯javascript实现选择框的全选与反选

    HTML部分 <div id="wrap_input_box" > <input type="checkbox"><br> ...

  3. android实现透明和半透明效果

    从透明到半透明时一个值的变化过程. #00000000(全透明)——#e0000000(半透明) 如果觉得半透明的效果太暗淡.可以设置成#60000000,#80000000,#a0000000等等

  4. js做全选,用一个checkbox复选框做多个checkbox复选框的全选按钮,有一个复选框未被选择时,全选按钮的checked就为false

    用一个checkbox复选框做多个checkbox复选框的全选按钮,有一个复选框未被选择时,全选按钮的checked就为false,当所有checkbox都被选中时,全选按钮也被选中. 详解: 有两种 ...

  5. Unity编辑器扩展Texture显示选择框

    学习NGUI插件的时候,突然间有一个问题为什么它这些属性可以通过弹出窗口来选中呢? 而我自己写的组件只能使用手动拖放的方式=.=. Unity开发了组件Inspector视图扩展API,如果我们要写插 ...

  6. select2 智能补全模糊查询select2的下拉选择框使用

    我们在上篇文章中已经在SpringMVC基础框架的基础上应用了BootStrap的后台框架,在此基础上记录select2的使用. 应用bootstrap模板 基础项目源码下载地址为: SpringMV ...

  7. angular4 checkbox复选框的全选,反选及个别选择

    <label><input type="checkbox" name="" [(ngModel)]="master"> ...

  8. selenium的下拉选择框

    今天总结下selenium的下拉选择框.我们通常会遇到两种下拉框,一种使用的是html的标签select,另一种是使用input标签做的假下拉框. 后者我们通常的处理方式与其他的元素类似,点击或使用J ...

  9. selenium之 下拉选择框Select

    今天总结下selenium的下拉选择框.我们通常会遇到两种下拉框,一种使用的是html的标签select,另一种是使用input标签做的假下拉框. 后者我们通常的处理方式与其他的元素类似,点击或使用J ...

随机推荐

  1. Sed命令的使用详细解释

    Sed命令的使用详细解释 一:sed命令的简介 sed是一种在线编辑器,它一次处理一行内容.处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space),接着用sed命令处 ...

  2. HDU6582 Path【优先队列优化最短路 + dinic最大流 == 最小割】

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6582 来源:2019 Multi-University Training Contest 1 题目大意 ...

  3. lua table 的操作(四)

    table在前面作过介绍,它是一种关联数组,这种关联指的是可以设置各类类型的key来存储值. 1.table 间的数据传递 -- 为 table a 并设置元素,然后将 a 赋值给 b,则 a 与 b ...

  4. [转帖]三款Nehalem至强5500塔式服务器横评对决(4)

    三款Nehalem至强5500塔式服务器横评对决(4) http://tech.sina.com.cn/b/2009-12-14/05051172233_4.shtml 可以看到两路服务器的设置 基本 ...

  5. [转]史上最最最详细的手写Promise教程

    我们工作中免不了运用promise用来解决异步回调问题.平时用的很多库或者插件都运用了promise 例如axios.fetch等等.但是你知道promise是咋写出来的呢? 别怕-这里有本promi ...

  6. 更改oracle RAC public ip,vip,scan ip和private ip

    更改oracle RAC public ip,vip,scan ip和private ip oifcfg - Oracle 接口配置工具 用法:  oifcfg iflist [-p [-n]]    ...

  7. NOIP(CSP)答题技巧&小细节

    1.主函数类型 通常使用int main(),然而可以使用完全等价的signed main() 解锁 #define int long long  的操作 2.long long 的使用 数列长度/边 ...

  8. 使用rsync工具构建php项目管理平台

    对于phper来说部署项目和更新项目是很方便的,只要直接将写好的项目覆盖到项目的根目录就可以啦.但是平时项目开发的时候肯定不是只部署一个环境,一般是三套环境(开发环境.测试环境.生产环境),我们每次在 ...

  9. Thinkphp5+Layui上传图片

    ThinkPHP是一个免费开源的,快速.简单的面向对象的轻量级PHP开发框架,是为了敏捷WEB应用开发和简化企业应用开发而诞生的.ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能 ...

  10. RabbitMQ快速开始

    ①:安装rabbitmq所需要的依赖包 yum install build-essential openssl openssl-devel unixODBC unixODBC-devel make g ...