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; | |
| using UnityEngine; | |
| using Unity.Entities; | |
| using Unity.Jobs; | |
| using Unity.Collections; | |
| public class Loader : MonoBehaviour | |
| { | |
| World myWorld; | |
| EntityManager myEntityManager; |
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 UnityEditor; | |
| using UnityEditor.ShortcutManagement; | |
| using UnityEngine; | |
| using UnityEngine.Assertions; | |
| namespace RenLibEditor | |
| { | |
| [ExecuteInEditMode] | |
| public class CameraTracking | |
| { |
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; | |
| /// <summary> | |
| /// A free camera that allows you to fly around the scene freely, similar to Unity's scene view camera. | |
| /// </summary> | |
| public class FreeCameraController : MonoBehaviour | |
| { | |
| public float m_LookSpeedMouse = 10.0f; | |
| public float m_MoveSpeed = 50.0f; |
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 "TextMeshPro/TextMesh Billboard" { | |
| Properties { | |
| [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1) | |
| _FaceDilate ("Face Dilate", Range(-1,1)) = 0 | |
| [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1) | |
| _OutlineWidth ("Outline Thickness", Range(0,1)) = 0 | |
| _OutlineSoftness ("Outline Softness", Range(0,1)) = 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
| //计算屏幕点击处,和3D空间中的线段,在屏幕空间中的最短距离 | |
| public static float DetectClickOnLine(Camera camera,Vector3 p1, Vector3 p2) | |
| { | |
| var v1 = camera.WorldToScreenPoint(p1); | |
| var v2 =camera.WorldToScreenPoint(p2); | |
| Vector2 point = Input.mousePosition; | |
| //计算点到直线的距离 | |
| var xDis = v2.x - v1.x; |
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.IO; | |
| using UnityEditor; | |
| using UnityEditorInternal; | |
| using UnityEngine; | |
| namespace UnityDocTool | |
| { | |
| public class ScreenShotHelper | |
| { | |
| //https://stackoverflow.com/questions/48663073/editor-window-screenshot |
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
| // Euler angles rotation matrix | |
| float3x3 RotationMatrixFromEuler(float3 v) | |
| { | |
| float sx, cx; | |
| float sy, cy; | |
| float sz, cz; | |
| sincos(v.x, sx, cx); | |
| sincos(v.y, sy, cy); | |
| sincos(v.z, sz, cz); |