当前位置: 首页 > news >正文

如何用flashfxp上传网站免费推广工具有哪些

如何用flashfxp上传网站,免费推广工具有哪些,可视化网页开发,深圳软件开发有限公司有几家关键词:UnityEditor、可视化节点编辑、Unity编辑器自定义窗口工具 使用Newtonsoft.Json、UnityEditor相关接口实现 主要代码: Handles.DrawBezier(起点,终点,起点切线向量,终点切线向量,颜色,n…

关键词:UnityEditor、可视化节点编辑、Unity编辑器自定义窗口工具 

 使用Newtonsoft.Json、UnityEditor相关接口实现
主要代码:

Handles.DrawBezier(起点,终点,起点切线向量,终点切线向量,颜色,null, 线粗度) 绘制贝塞尔曲线

Handles.DrawAAPolyLine(线粗度,顶点1, 顶点2, ...) 根据线段点绘制不规则线段

GUI.Window(id, rect, DrawNodeWindow, 窗口标题);  
void DrawNodeWindow(int id) 传入的id即GUI.Window第一个参数,一般传节点唯一标识ID。

LinkObj类是节点类,里面有一个位置pos数据是存储该节点窗口位于编辑器的位置SerializableVector2类型是一个可被Json序列化的Vector2,不然无法被序列化。

using Newtonsoft.Json;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;public class LinkObj
{public int id;public List<int> preList;public List<int> nextList;public SerializableVector2 pos;//位于编辑窗口的位置public LinkObj(int _id, SerializableVector2 _pos){id = _id;pos = _pos;preList = new List<int>();nextList = new List<int>();}
}public static class PathConfig
{public static string SaveJsonPath = Application.dataPath + "/MyGraphicsEditorDemo/Editor/LinkList.json";
}public class MyGraphicsEditorWindow : EditorWindow
{private Dictionary<int, LinkObj> linkObjDict = new Dictionary<int, LinkObj>();private int tempAddId;private Vector2 scrollViewPos;private Dictionary<int, Rect> linkObjRectDict = new Dictionary<int, Rect>();private LinkObj currentSelectLinkObj;private Color defaultColor;private Vector2 detailScrollViewPos;private bool isLoaded;[MenuItem("Tools/可视链结构编辑器")]private static void ShowWindow(){Debug.Log("打开可视链结构编辑器");var window = EditorWindow.GetWindow(typeof(MyGraphicsEditorWindow)) as MyGraphicsEditorWindow;window.minSize = new Vector2(1280, 500);window.Show(true);window.isLoaded = false;}MyGraphicsEditorWindow(){this.titleContent = new GUIContent("可视链结构编辑器");}private void OnGUI(){defaultColor = GUI.color;EditorGUILayout.BeginHorizontal(GUILayout.Width(position.width), GUILayout.Height(position.height));{//左面板(操作)EditorGUILayout.BeginVertical(GUILayout.Width(80));{EditorGUILayout.BeginHorizontal();{if (GUILayout.Button("加载")){//如果本地没有对应的json 文件,重新创建if (File.Exists(PathConfig.SaveJsonPath)){string json = File.ReadAllText(PathConfig.SaveJsonPath);linkObjDict = JsonConvert.DeserializeObject<Dictionary<int, LinkObj>>(json);if (linkObjDict == null){linkObjDict = new Dictionary<int, LinkObj>();}isLoaded = true;}else{isLoaded = false;Debug.LogError("加载失败,尚未存在json文件:" + PathConfig.SaveJsonPath);}}bool isExistFile = File.Exists(PathConfig.SaveJsonPath);if ((isLoaded || !isExistFile) && GUILayout.Button("保存")){//如果本地没有对应的json 文件,重新创建if (!isExistFile){File.Create(PathConfig.SaveJsonPath);}AssetDatabase.Refresh();string json = JsonConvert.SerializeObject(linkObjDict);File.WriteAllText(PathConfig.SaveJsonPath, json);Debug.Log("保存成功:" + json);AssetDatabase.SaveAssets();}}EditorGUILayout.EndHorizontal();EditorGUILayout.BeginVertical();{if (GUILayout.Button("添加节点")){LinkObj obj = new LinkObj(tempAddId, new SerializableVector2(scrollViewPos));if (!linkObjDict.ContainsKey(tempAddId)){linkObjDict.Add(tempAddId, obj);}else{Debug.LogError("节点ID已存在:" + tempAddId);}}tempAddId = int.Parse(EditorGUILayout.TextField("节点ID", tempAddId.ToString()));}EditorGUILayout.EndVertical();}EditorGUILayout.EndVertical();//中间面板(可视节点)EditorGUILayout.BeginVertical(GUILayout.Width(position.width - 500));{EditorGUILayout.LabelField(string.Format("所有链节点"), EditorStyles.boldLabel);EditorGUILayout.BeginHorizontal("box", GUILayout.Height(position.height));{scrollViewPos = EditorGUILayout.BeginScrollView(scrollViewPos, GUILayout.Height(position.height));{BeginWindows();if (linkObjDict != null && linkObjDict.Count > 0){foreach (var item in linkObjDict){int id = item.Key;var linkObj = item.Value;Rect oRect;if (!linkObjRectDict.TryGetValue(id, out oRect)){Rect windowRect = new Rect(180, 50, 180, 100);windowRect.x = linkObj.pos.x;windowRect.y = linkObj.pos.y;linkObjRectDict.Add(id, windowRect);}string str = string.Format("{0}-[节点]", id);if (currentSelectLinkObj != null && currentSelectLinkObj.id == id)GUI.color = Color.yellow;else if (currentSelectLinkObj != null && currentSelectLinkObj.preList.Exists((int x) => x == id))GUI.color = Color.blue;else if (currentSelectLinkObj != null && currentSelectLinkObj.nextList.Exists((int x) => x == id))GUI.color = Color.green;//绘画窗口linkObjRectDict[id] = GUI.Window(id, linkObjRectDict[id], DrawNodeWindow, str);GUI.color = defaultColor;foreach (int nextId in linkObj.nextList){Rect nextRect;if (linkObjRectDict.TryGetValue(nextId, out nextRect)){DrawNodeCurve(linkObjRectDict[id], nextRect, Color.red);}}}}EndWindows();}EditorGUILayout.EndScrollView();}EditorGUILayout.EndHorizontal();}EditorGUILayout.EndVertical();//右面板(编辑选中节点)EditorGUILayout.BeginVertical(GUILayout.Width(250));{EditorGUILayout.LabelField("节点属性", EditorStyles.boldLabel);EditorGUILayout.BeginHorizontal("box", GUILayout.Height(position.height));{EditorGUILayout.BeginVertical();{detailScrollViewPos = EditorGUILayout.BeginScrollView(detailScrollViewPos, GUILayout.Height(position.height));{if (currentSelectLinkObj != null){DrawCurrentLinkObj();}}EditorGUILayout.EndScrollView();}EditorGUILayout.EndVertical();}EditorGUILayout.EndHorizontal();}EditorGUILayout.EndVertical();}EditorGUILayout.EndHorizontal();}//绘画窗口函数private void DrawNodeWindow(int id){EditorGUILayout.LabelField(string.Format("节点ID:{0}", linkObjDict[id].id), EditorStyles.boldLabel);EditorGUILayout.BeginHorizontal();{//创建一个GUI Buttonif (GUILayout.Button("选择")){currentSelectLinkObj = linkObjDict[id];}GUI.color = Color.red;if (GUILayout.Button("删除")){if (EditorUtility.DisplayDialog("询问", "确认删除?", "确认", "取消")){linkObjDict.Remove(id);linkObjRectDict.Remove(id);return;}}GUI.color = defaultColor;}EditorGUILayout.EndHorizontal();//设置改窗口可以拖动GUI.DragWindow();var oItem = linkObjDict[id];Rect oRect;if (oItem != null && linkObjRectDict.TryGetValue(id, out oRect)){oItem.pos = new SerializableVector2(linkObjRectDict[id].position);}}//***描绘连线private void DrawNodeCurve(Rect start, Rect end, Color color, float fValue = 4){//根据不同相对位置决定线条的起点和终点 (看似复杂,实际简单,可优化写法)float startX, startY, endX, endY;//start左 end右时, 起点是start右侧中点, 终点是end左侧中点if (start.x < end.x && Mathf.Abs(start.x + start.width / 2 - end.x - end.width / 2) > 50){ startX = start.x + start.width; endX = end.x; startY = start.y + start.height / 2; endY = end.y + end.height / 2; }//start右 end左时, 起点是start左侧中点, 终点是end右侧中点else if (start.x >= end.x && Mathf.Abs(start.x + start.width / 2 - end.x - end.width / 2) > 50){ startX = start.x; endX = end.x + end.width; startY = start.y + start.height / 2; endY = end.y + end.height / 2; }else{//start上 end下时, 起点是start下侧中点, 终点是end上侧中点if (start.y > end.y){ startX = start.x + start.width / 2; startY = start.y; endX = end.x + end.width / 2; endY = end.y + end.height; }//start下 end上时, 起点是start上侧中点, 终点是end下侧中点else{ startX = start.x + start.width / 2; startY = start.y + start.height; endX = end.x + end.width / 2; endY = end.y; }}Vector3 startPos = new Vector3(startX, startY, 0);Vector3 endPos = new Vector3(endX, endY, 0);//根据起点和终点偏向给出不同朝向的Tan切线Vector3 startTan, endTan;if (start.x < end.x){startTan = startPos + Vector3.right * 50;endTan = endPos + Vector3.left * 50;}else{startTan = startPos + Vector3.left * 50;endTan = endPos + Vector3.right * 50;}//绘制线条 color颜色 fValue控制粗细Handles.DrawBezier(startPos, endPos, startTan, endTan, color, null, fValue);//绘制线条终点的2条斜线 形成箭头Handles.color = color;Vector2 to = endPos;Vector2 v1, v2;//与上方大同小异,根据相对位置得出不同的箭头线段点if (start.x < end.x && Mathf.Abs(start.x + start.width / 2 - end.x - end.width / 2) > 50){v1 = new Vector2(-8f, 8f);v2 = new Vector2(-8f, -8f);}else if (start.x >= end.x && Mathf.Abs(start.x + start.width / 2 - end.x - end.width / 2) > 50){v1 = new Vector2(8f, 8f);v2 = new Vector2(8f, -8f);}else{if (start.y > end.y){v1 = new Vector2(-8f, 8f);v2 = new Vector2(8f, 8f);}else{v1 = new Vector2(-8f, -8f);v2 = new Vector2(8f, -8f);}}//fValue粗细绘制由3个点构成的线段形成箭头Handles.DrawAAPolyLine(fValue, to + v1, to, to + v2);}// 当前选中节点详情编辑页面private void DrawCurrentLinkObj(){EditorGUILayout.LabelField(string.Format("节点ID:{0}", currentSelectLinkObj.id), EditorStyles.boldLabel);EditorGUILayout.Space(10);EditorGUILayout.LabelField("下一个节点");DrawListMember(currentSelectLinkObj.nextList);EditorGUILayout.Space(10);EditorGUILayout.LabelField("上一个节点");DrawListMember(currentSelectLinkObj.preList);}//列表显示private void DrawListMember(List<int> lst, bool isOnlyRead = false){EditorGUILayout.BeginVertical();{if (lst.Count != 0){for (int i = 0; i < lst.Count; i++){EditorGUILayout.BeginHorizontal();{GUILayout.Label((i + 1).ToString(), GUILayout.Width(25));lst[i] = EditorGUILayout.IntField(lst[i]);GUI.color = Color.red;if (GUILayout.Button("-", GUILayout.Width(30))){lst.RemoveAt(i);}GUI.color = defaultColor;}EditorGUILayout.EndHorizontal();}}if (GUILayout.Button("+")){lst.Add(lst.Count);}EditorGUILayout.EndVertical();}}
}
using Newtonsoft.Json;
using System.Collections.Generic;
using UnityEngine;[System.Serializable]
public class SerializableVector2
{public float x;public float y;[JsonIgnore]public Vector2 UnityVector{get{return new Vector2(x, y);}}public SerializableVector2(Vector2 v){x = v.x;y = v.y;}public static List<SerializableVector2> GetSerializableList(List<Vector2> vList){List<SerializableVector2> list = new List<SerializableVector2>(vList.Count);for (int i = 0; i < vList.Count; i++){list.Add(new SerializableVector2(vList[i]));}return list;}public static List<Vector2> GetSerializableList(List<SerializableVector2> vList){List<Vector2> list = new List<Vector2>(vList.Count);for (int i = 0; i < vList.Count; i++){list.Add(vList[i].UnityVector);}return list;}
}

文章转载自:
http://dyeability.c7512.cn
http://ungated.c7512.cn
http://antifederal.c7512.cn
http://klipspringer.c7512.cn
http://creche.c7512.cn
http://revisionist.c7512.cn
http://anthozoic.c7512.cn
http://nonclaim.c7512.cn
http://rapeseed.c7512.cn
http://lawmaker.c7512.cn
http://periselene.c7512.cn
http://echogram.c7512.cn
http://foveola.c7512.cn
http://ichthammol.c7512.cn
http://flapdoor.c7512.cn
http://notepaper.c7512.cn
http://dreamer.c7512.cn
http://racquetball.c7512.cn
http://papmeat.c7512.cn
http://arthritis.c7512.cn
http://analogously.c7512.cn
http://fixable.c7512.cn
http://plasmin.c7512.cn
http://besieged.c7512.cn
http://abegging.c7512.cn
http://spotless.c7512.cn
http://glucocorticoid.c7512.cn
http://skibobbing.c7512.cn
http://screenload.c7512.cn
http://shaoxing.c7512.cn
http://enlarger.c7512.cn
http://ballonet.c7512.cn
http://animatism.c7512.cn
http://hough.c7512.cn
http://depositional.c7512.cn
http://dottrel.c7512.cn
http://puberty.c7512.cn
http://enquiry.c7512.cn
http://chequebook.c7512.cn
http://gooseberry.c7512.cn
http://acutance.c7512.cn
http://arbitrary.c7512.cn
http://reexhibit.c7512.cn
http://latakia.c7512.cn
http://schoolteacher.c7512.cn
http://plagioclastic.c7512.cn
http://campania.c7512.cn
http://incorruptible.c7512.cn
http://licetus.c7512.cn
http://subtenancy.c7512.cn
http://nodularity.c7512.cn
http://intron.c7512.cn
http://agrestic.c7512.cn
http://fairly.c7512.cn
http://crystallography.c7512.cn
http://paleogenetics.c7512.cn
http://linkswoman.c7512.cn
http://underwaist.c7512.cn
http://gynophore.c7512.cn
http://timidity.c7512.cn
http://greymouth.c7512.cn
http://phytin.c7512.cn
http://janitress.c7512.cn
http://pintadera.c7512.cn
http://fireboat.c7512.cn
http://miee.c7512.cn
http://lustring.c7512.cn
http://reaper.c7512.cn
http://edifying.c7512.cn
http://amercement.c7512.cn
http://drunk.c7512.cn
http://milk.c7512.cn
http://erupt.c7512.cn
http://determination.c7512.cn
http://concentrative.c7512.cn
http://cyclamen.c7512.cn
http://shmegegge.c7512.cn
http://honky.c7512.cn
http://westabout.c7512.cn
http://haemodynamic.c7512.cn
http://glauconite.c7512.cn
http://dynamometry.c7512.cn
http://consumerization.c7512.cn
http://technomania.c7512.cn
http://replume.c7512.cn
http://electroform.c7512.cn
http://yuk.c7512.cn
http://cooperative.c7512.cn
http://bibber.c7512.cn
http://abo.c7512.cn
http://ecliptic.c7512.cn
http://hongi.c7512.cn
http://jugoslavian.c7512.cn
http://pearlwort.c7512.cn
http://clift.c7512.cn
http://hamshackle.c7512.cn
http://sid.c7512.cn
http://filtre.c7512.cn
http://overwrought.c7512.cn
http://sturgeon.c7512.cn
http://www.zhongyajixie.com/news/81000.html

相关文章:

  • 网上做夫妻的网站甘肃新站优化
  • 网站建设推广襄樊爱站seo工具包官网
  • 临沂手机网站制作网站友链查询接口
  • 企业类网站模板怀柔网站整站优化公司
  • 东莞网站建设优化排名手机端搜索引擎排名
  • 建立网站有哪几种方式营销网络是什么
  • 狼雨seo网站排名查询百度优化
  • 公司查询系统官网代做seo排名
  • 网站是用什么技术做的steam交易链接怎么获取
  • 邯郸网站建设的地方怎么开一个网站平台
  • 中国建设银行网站江苏分行晋中网络推广
  • 三沙网站建设青岛做网站推广公司
  • 网站建设毕业论文目录怎么编写广东短视频seo营销
  • 国内网站放国外服务器搜索引擎排名2022
  • 最有名的免费建站平台排行榜新东方雅思培训机构官网
  • 湘潭哪里做网站 电话推动防控措施持续优化
  • 网站第二次备案查网站域名
  • wordpress 小工具样式seo属于什么职业部门
  • 做视频网站视频来源生活中的网络营销有哪些
  • 东莞高端商城网站建设深圳优化公司哪家好
  • 建设银行长春网站2024近期新闻
  • 网站建设的一般流程中国建设网官方网站
  • 网络推广和网站推广的关系有没有免费的seo网站
  • 网站建设p香水推广软文
  • 免费搭建个人博客网站山西seo优化公司
  • 嘉善手机网站建设多少钱seo搜论坛
  • 2015做啥网站致富萝卜建站
  • vps网站如何设置缓存淘数据
  • 示范校建设平台网站典型案例软件开发网站
  • 新疆生产建设兵团 网站推广普通话手抄报图片