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 UnityEngine; | |
using UnityEditor; | |
using UnityEditorInternal; | |
using UnityEditor.Profiling; | |
using System.Text; | |
public class PrintProfilerCpuUsage | |
{ |
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; | |
char[] text = { 'a', 'b', '\0', 'c', 'd' }; | |
int length = 0; | |
for (int i = 0; i < text.Length; i++) | |
{ | |
if (text[i] == '\0') | |
{ | |
length = i; |
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; | |
using System.Collections; | |
using System.Collections.Generic; | |
List<int> list = new List<int>(new DefaultInitCollection(10)); | |
foreach (var e in list) | |
{ | |
Console.WriteLine(e); | |
} |
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 UnityEditor; | |
using UnityEditorInternal; | |
using UnityEditorInternal.Profiling; | |
public class ProfilerText : Editor | |
{ | |
[MenuItem("Editor/Print Profiler Text")] | |
static void Print() | |
{ |
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 int[] ParseCSV(string t) | |
{ | |
if (t.IndexOf(',') == -1) | |
{ | |
return new int[] { int.Parse(t) }; | |
} | |
int count = 0; | |
for (int i = 0; i < t.Length; i++) | |
{ | |
if (t[i] == ',') |
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
static int ParseInt(string t, int s, int l) | |
{ | |
if (string.IsNullOrEmpty(t)) | |
{ | |
return 0; | |
} | |
if (s + l > t.Length) | |
{ | |
l = t.Length - s; |
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 IntToStringUtil | |
{ | |
public static string Padding0(int n, int d) | |
{ | |
char[] c = new char[n < 0 ? d + 1 : d]; | |
int s = 0; | |
if (n < 0) | |
{ | |
c[0] = '-'; | |
n *= -1; |
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 StringBuilderUtil | |
{ | |
public static void AppendInt(System.Text.StringBuilder sb, int value) | |
{ | |
int n = value; | |
if (n < 0) | |
{ | |
sb.Append('-'); | |
n *= -1; | |
} |
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 UnityEngine; | |
using UnityEditor; | |
public class AnimationEventView : EditorWindow | |
{ | |
[MenuItem("Editor/Animation Event View")] | |
public static void Open() | |
{ |
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 UnityEngine; | |
using UnityEngine.Networking; | |
public class DownloadTextureTest : MonoBehaviour | |
{ | |
[SerializeField] | |
string url1 = null; | |
[SerializeField] |
NewerOlder