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 rootPath = EMG_FileUtils.PersistentDataPath + $"/{ProjectName}/Script"; | |
if (!Directory.Exists(rootPath)) | |
{ | |
Directory.CreateDirectory(rootPath); | |
} | |
var allFilePath = Directory.GetFiles(rootPath, "*.lua"); | |
foreach (var filePath in allFilePath) | |
{ |
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 UnityEngine; | |
public class PreGame_Mono_ParabolaMove : MonoBehaviour | |
{ | |
[OnValueChanged(nameof(DoRefresh))] | |
public Vector3 Distance = Vector3.one; | |
[OnValueChanged(nameof(DoRefresh)), Range(0, 1)] | |
public float DistancePercent = 0.5f; |
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 ray = Game.MainGame.Logic.Camera.UnityCamera.ScreenPointToRay(Mouse.current.position.ReadValue()); | |
mGroundPlane.Raycast(ray, out var hitDistance); | |
var hitPoint = ray.GetPoint(hitDistance); |
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 void OrbitCamera() | |
{ | |
//orbit camera - 让相机在一个固定水平高度上绕着物体旋转.用于第三人称视角时候人物跟踪 | |
//lookAngle为定义的视角new Vector(45,30,0) 表示离地角度是45°,水平旋转角度是30° | |
//因为是正交相机,所以相机距离物体远近无异议,所以才用常量20f作为距离 | |
var lookQuaternion = Quaternion.Euler(lookAngle); | |
var lookDirection = lookQuaternion * Vector3.forward; | |
var lookPosition = transform.position - lookDirection * 20f; | |
Camera.SetPositionAndRotation(lookPosition, lookQuaternion); | |
} |
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; | |
public class Mono_CompoundTrigger : MonoBehaviour | |
{ | |
public class ColliderInfo | |
{ | |
public Collider target; | |
public int count; | |
} |
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 Code.CopyEngine.Core.Utils; | |
using UnityEngine; | |
namespace Code.Utils.Tilemap2Mesh | |
{ | |
public class Tilemap2Mesh_LayerMeshGenerator | |
{ | |
public Dictionary<Vector2Int, bool> mMarkDic = new(); |
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" | |
} |
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
/// <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
private static void Write_Common(NetworkWriter writer, IMessage _target) | |
{ | |
byte[] bytes = null; | |
if (_target != null) | |
{ | |
bytes = _target.ToByteArray(); | |
} | |
if (bytes is {Length: > 0}) | |
{ |
NewerOlder