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.Collections.Generic; | |
| using System.Linq; | |
| using System.Text.RegularExpressions; | |
| /// <summary> | |
| /// String型の拡張メソッドを管理するクラス | |
| /// </summary> | |
| public static partial class StringExtensions | |
| { |
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.Linq; | |
| using System.Text; | |
| using System.Collections.Generic; | |
| using System.Globalization; | |
| public static partial class StringExtensions | |
| { | |
| public static sbyte ToSByte(this string s) | |
| { |
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
| public static partial class StringExtensions | |
| { | |
| /// <summary> | |
| /// 1バイト文字で構成された文字列かどうかを確認します | |
| /// </summary> | |
| /// <param name="str">確認対象の文字列</param> | |
| /// <returns>1バイト文字のみで構成された文字列の場合 true</returns> | |
| public static bool IsOneByteStr(string str) | |
| { | |
| var bytes = System.Text.Encoding.GetEncoding(932).GetBytes(str); |
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 UnityEngine; | |
| public class MyAssetPostprocessor : AssetPostprocessor | |
| { | |
| /// <summary> | |
| /// すべてのアセットのインポートが終了した際に呼び出されます | |
| /// </summary> | |
| /// <param name="importedAssets">インポートされたアセットのパス</param> | |
| /// <param name="deletedAssets">削除されたアセットのパス</param> |
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; | |
| public class MyPropertyAttribute : PropertyAttribute | |
| { | |
| public string Label; | |
| public MyPropertyAttribute(string label) | |
| { | |
| Label = label; | |
| } |
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 UnityEngine; | |
| [CustomPropertyDrawer(typeof(MyPropertyAttribute))] | |
| public class MyPropertyDrawer : PropertyDrawer | |
| { | |
| public override void OnGUI( | |
| Rect position, | |
| SerializedProperty property, | |
| GUIContent label) |
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.Text.RegularExpressions; | |
| using UnityEngine; | |
| #if UNITY_EDITOR | |
| using UnityEditor; | |
| #endif | |
| public class RegexAttribute : PropertyAttribute | |
| { | |
| public readonly string Pattern; | |
| public readonly string HelpMessage; |
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; | |
| #if UNITY_EDITOR | |
| using UnityEditor; | |
| #endif | |
| public class MyPropertyAttribute : PropertyAttribute | |
| { | |
| public string Label; | |
| public MyPropertyAttribute(string label) |
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; | |
| public static class MyClassCreator | |
| { | |
| [MenuItem("Tools/Create My Class")] | |
| private static void Create() | |
| { | |
| // ファイルに書き込む文字列を作成します | |
| var builder = new System.Text.StringBuilder(); | |
| builder.AppendLine("public class MyClass"); |
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; | |
| /// <summary> | |
| /// アセットをインポートする時の処理を記述します | |
| /// </summary> | |
| public class TexturePreprocessor : AssetPostprocessor | |
| { | |
| /// <summary> | |
| /// テクスチャをインポートする直前に呼び出されます |