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.UI; | |
public class JoystickController : MonoBehaviour { | |
public RectTransform center; | |
public RectTransform knob; | |
public float range; |
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; | |
using System.Collections.Generic; | |
public class Arrays : MonoBehaviour { | |
public string[] familyMembers = new string[]{"Dharma","Greg","Zen","Karma","Serenity"}; | |
public int[] numbers; | |
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 GameObject FindChild(Transform trans , string childName) | |
{ | |
Transform child = trans.Find(childName); | |
if (child != null) | |
{ | |
return child.gameObject; | |
} | |
int count = trans.childCount; | |
GameObject go = null; | |
for(int i = 0 ; i < count ; ++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
public static string GetMinuteTime(float time) | |
{ | |
int mm,ss; | |
string stime = "0:00"; | |
if (time<=0) return stime; | |
mm = (int)time/60; | |
ss = (int)time%60; | |
if(mm>60) | |
stime = "59:59"; | |
else if (mm <10 && ss >=10) |
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.Generic; | |
class ArrayHelper | |
{ | |
static public void OrderBy<T, TKey>(T[] array, SelectHandler<T, TKey> handler) | |
where TKey : IComparable,IComparable<TKey> | |
{ | |
for (int i = 0; i < array.Length - 1; 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 UnityEngine; | |
using System.Collections.Generic; | |
using System; | |
public static class CollectionHelper | |
{ | |
public delegate bool FindHandler<T>(T item); | |
public delegate TKey SelectHandler<TSource, TKey>(TSource source); | |
public static void OrderBy<T, TKey>(T[] array, SelectHandler<T, TKey> handler) |
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 TransformHelper | |
{ | |
public static Transform FindChild(Transform parent, string goName) | |
{ | |
var child = parent.Find(goName); | |
if (child != null) return child; |
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; | |
public class RayController : MonoBehaviour{ | |
public bool debug; | |
RaycastHit hit; | |
public Transform from; | |
public Transform to; | |
public Ray Ray{ | |
get |
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 System; | |
//For general object operations | |
public class PoolObjectInfo : MonoBehaviour | |
{ | |
//Resource Type | |
public string Type { get { return _Type; } private set { _Type = value; } } | |
[SerializeField] |
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 void GroupResize (int Size, ref GameObject[] Group) | |
{ | |
GameObject[] temp = new GameObject[Size]; | |
for (int c = 1; c < Mathf.Min(Size, Group.Length); c++ ) { | |
temp [c] = Group [c]; | |
} | |
Group = temp; | |
} | |
OlderNewer