This file contains 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 System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
namespace ruihanyang.ConfigHelper | |
{ | |
/// <summary> | |
/// <para>配置助手</para> |
This file contains 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 System.Collections; | |
public class SmoothCameraFollow : MonoBehaviour { | |
static public Transform target; | |
public float distance = 4.0f; | |
public float height = 1.0f; | |
public float smoothLag = 0.2f; | |
public float maxSpeed = 10.0f; |
This file contains 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 System.Collections; | |
public class TouchIgnore : MonoBehaviour, ICanvasRaycastFilter | |
{ | |
public bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera) | |
{ | |
return false; | |
} | |
} |
This file contains 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
public class ReadFromFile { | |
/** | |
* 以字节为单位读取文件,常用于读二进制文件,如图片、声音、影像等文件。 | |
*/ | |
public static void readFileByBytes(String fileName) { | |
File file = new File(fileName); | |
InputStream in = null; | |
try { | |
System.out.println("以字节为单位读取文件内容,一次读一个字节:"); | |
// 一次读一个字节 |
This file contains 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
public class AppendToFile { | |
/** | |
* A方法追加文件:使用RandomAccessFile | |
*/ | |
public static void appendMethodA(String fileName, String content) { | |
try { | |
// 打开一个随机访问文件流,按读写方式 | |
RandomAccessFile randomFile = new RandomAccessFile(fileName, "rw"); | |
// 文件长度,字节数 | |
long fileLength = randomFile.length(); |
This file contains 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 System.Collections.Generic; | |
using System.Text.RegularExpressions; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class ForeachCharUtil : MonoBehaviour | |
{ | |
public enum ShowContentStatus | |
{ |
This file contains 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.Runtime.Serialization; | |
using System.Runtime.Serialization.Formatters.Binary; | |
using System.IO; | |
public class SerializeHelper | |
{ | |
/// <summary> | |
/// 序列化 | |
/// </summary> | |
/// <returns>The message queue.</returns> |
This file contains 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 System.Collections.Generic; | |
using System.IO; | |
using UnityEditor; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class TextContentMatchUtil : EditorWindow | |
{ | |
[MenuItem("Tools/Text组件内容匹配")] |
This file contains 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
{ | |
// 使用 IntelliSense 了解相关属性。 | |
// 悬停以查看现有属性的描述。 | |
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Unity Editor", | |
"type": "unity", |
This file contains 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
public static class GameObjectUtil | |
{ | |
#if UNITY_EDITOR | |
public static GameObject FindGameObject(this GameObject obj, string name, bool includeInactive = true, bool showError = true) | |
{ | |
Transform[] trs = obj.GetComponentsInChildren<Transform>(true); | |
foreach (Transform t in trs) | |
{ |
OlderNewer