From 39001a600fcae2bcf27c225df8752d75fb92fef4 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 31 十月 2025 11:18:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/Component/UI/Decorate/Graph/OffsetImage.cs | 130 +++++++++++++++++++++----------------------
1 files changed, 64 insertions(+), 66 deletions(-)
diff --git a/Main/Component/UI/Decorate/Graph/OffsetImage.cs b/Main/Component/UI/Decorate/Graph/OffsetImage.cs
index 623b32d..aaa38a6 100644
--- a/Main/Component/UI/Decorate/Graph/OffsetImage.cs
+++ b/Main/Component/UI/Decorate/Graph/OffsetImage.cs
@@ -1,5 +1,5 @@
锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
+// [Author]: 鐜╀釜娓告垙
// [ Date ]: Wednesday, August 23, 2017
//--------------------------------------------------------
using UnityEngine;
@@ -8,86 +8,83 @@
using System;
using System.Collections.Generic;
-namespace vnxbqy.UI {
- public class OffsetImage:BaseMeshEffect {
+public class OffsetImage:BaseMeshEffect {
- [SerializeField]
- Vector2 m_Offset;
- public Vector2 offset {
- get {
- return m_Offset;
- }
- set {
- m_Offset = value;
+ [SerializeField]
+ Vector2 m_Offset;
+ public Vector2 offset {
+ get {
+ return m_Offset;
+ }
+ set {
+ m_Offset = value;
+ }
+ }
+
+ public override void ModifyMesh(VertexHelper vh) {
+ List<UIVertex> vertexs = new List<UIVertex>();
+ vh.GetUIVertexStream(vertexs);
+
+ if(vertexs == null || vertexs.Count == 0) {
+ return;
+ }
+ vh.Clear();
+
+ var positions = new Vector3[3];
+ var uv0s = new Vector2[3];
+
+ var firstQuard = new UIVertex[6] {
+ vertexs[0],
+ vertexs[1],
+ vertexs[2],
+ vertexs[3],
+ vertexs[4],
+ vertexs[5]
+ };
+
+ for(var i = 0;i < firstQuard.Length;i++) {
+ var vertex = firstQuard[i];
+ var position = vertex.position + new Vector3(offset.x,offset.y,0);
+ vertex.position = position;
+ firstQuard[i] = vertex;
+
+ if((i % 3) == 2) {
+ positions[0] = firstQuard[i - 2].position;
+ uv0s[0] = firstQuard[i - 2].uv0;
+ positions[1] = firstQuard[i - 1].position;
+ uv0s[1] = firstQuard[i - 1].uv0;
+ positions[2] = firstQuard[i].position;
+ uv0s[2] = firstQuard[i].uv0;
+
+ UIUtility.AddTriangle(vh,positions,Color.white,uv0s);
}
}
- public override void ModifyMesh(VertexHelper vh) {
- List<UIVertex> vertexs = new List<UIVertex>();
- vh.GetUIVertexStream(vertexs);
- if(vertexs == null || vertexs.Count == 0) {
- return;
- }
- vh.Clear();
- var positions = new Vector3[3];
- var uv0s = new Vector2[3];
+ var index = 5 * 6;
+ for(int i = 0;i < vertexs.Count;i++) {
- var firstQuard = new UIVertex[6] {
- vertexs[0],
- vertexs[1],
- vertexs[2],
- vertexs[3],
- vertexs[4],
- vertexs[5]
- };
+ if(i > index) {
- for(var i = 0;i < firstQuard.Length;i++) {
- var vertex = firstQuard[i];
- var position = vertex.position + new Vector3(offset.x,offset.y,0);
- vertex.position = position;
- firstQuard[i] = vertex;
-
- if((i % 3) == 2) {
- positions[0] = firstQuard[i - 2].position;
- uv0s[0] = firstQuard[i - 2].uv0;
- positions[1] = firstQuard[i - 1].position;
- uv0s[1] = firstQuard[i - 1].uv0;
- positions[2] = firstQuard[i].position;
- uv0s[2] = firstQuard[i].uv0;
-
- UIUtility.AddTriangle(vh,positions,Color.white,uv0s);
- }
}
+ if((i % 3) == 2) {
+ positions[0] = vertexs[i - 2].position;
+ uv0s[0] = vertexs[i - 2].uv0;
+ positions[1] = vertexs[i - 1].position;
+ uv0s[1] = vertexs[i - 1].uv0;
+ positions[2] = vertexs[i].position;
+ uv0s[2] = vertexs[i].uv0;
-
- var index = 5 * 6;
- for(int i = 0;i < vertexs.Count;i++) {
-
- if(i > index) {
-
- }
-
- if((i % 3) == 2) {
- positions[0] = vertexs[i - 2].position;
- uv0s[0] = vertexs[i - 2].uv0;
- positions[1] = vertexs[i - 1].position;
- uv0s[1] = vertexs[i - 1].uv0;
- positions[2] = vertexs[i].position;
- uv0s[2] = vertexs[i].uv0;
-
- UIUtility.AddTriangle(vh,positions,Color.white,uv0s);
- }
+ UIUtility.AddTriangle(vh,positions,Color.white,uv0s);
}
-
-
-
-
}
+
+
+
}
@@ -95,3 +92,4 @@
+
--
Gitblit v1.8.0