This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
public class TightImage : Image | |
{ | |
private RectTransform mRect; | |
private RectTransform RectTransform | |
{ | |
get |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tileMap = _t; | |
var bounds = tileMap.cellBounds; | |
var allTiles = tileMap.GetTilesBlock(bounds); | |
for (var x = 0; x < bounds.size.x; x++) | |
{ | |
for (var y = 0; y < bounds.size.y; y++) | |
{ | |
var tile = allTiles[x + y * bounds.size.x]; | |
if (tile == null) continue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sirenix.OdinInspector; | |
using UnityEditor; | |
using UnityEngine; | |
namespace Code.EditorTools.CreateMesh | |
{ | |
public class Mono_CreateQuadAssets : MonoBehaviour | |
{ | |
public Transform left_bottom; //0 | |
public Transform left_top; //1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 生成用于扫描的纹理 | |
/// </summary> | |
private static Mesh GenNavMesh() | |
{ | |
var walkAreaList = CEVoxelMeshGreedyOptimizer.Optimize(Game.Common.Map.MapSizeX, Game.Common.Map.MapSizeY, IsSameTile, IsHaveTile); | |
var vertices = new List<Vector3>(); | |
var triangles = new List<int>(); | |
var normals = new List<Vector3>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Threading; | |
using UnityEngine; | |
namespace Code.Dev.Network | |
{ | |
public class Test_UDP_Receive : MonoBehaviour |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
using Sirenix.OdinInspector; | |
using UnityEngine; | |
namespace Code.Dev.Network | |
{ | |
public class Test_UDP_Send : MonoBehaviour |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void Write_Common(NetworkWriter writer, IMessage _target) | |
{ | |
byte[] bytes = null; | |
if (_target != null) | |
{ | |
bytes = _target.ToByteArray(); | |
} | |
if (bytes is {Length: > 0}) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// World -> World | |
/// 比如房间的墙体放在Map里面去Gen,在Logic层存储的都是WorldTileIndex,这样和Modify的Tile去混合时候都可以使用一套相同的坐标系 | |
/// </summary> | |
public static Vector2Int WorldPos_To_WorldTileIndex(Vector3 _worldPos) { return new(Mathf.FloorToInt(_worldPos.x), Mathf.FloorToInt(_worldPos.y)); } | |
/// <summary> | |
/// 把Tilemap的局部Index转到世界做标下 | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
namespace Code | |
{ | |
/// <summary> | |
/// The simplest example to show how to use Graphics.DrawProceduralIndirect | |
/// | |
/// What it does: | |
/// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Eran/DrawProceduralIndirect/Basic" | |
{ | |
SubShader | |
{ | |
Tags | |
{ | |
"RenderPipeline"="UniversalPipeline" | |
"RenderType"="Opaque" | |
"Queue"="Geometry" | |
} |
OlderNewer