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
// targetが1秒かけて、座標(0,0,0)へ、イージングをしながら移動する | |
HOTween.To( | |
target.transform, | |
1f, | |
new TweenParms() | |
.Prop("position", Vector3.zero) | |
.Ease (EaseType.EaseOutBack) | |
); |
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
// WebブラウザのTwitter投稿画面を開く | |
Application.OpenURL("http://twitter.com/intent/tweet?text=" + WWW.EscapeURL("テキスト #hashtag")); | |
// Lineに投稿 | |
Application.OpenURL("http://line.naver.jp/R/msg/text/?" + WWW.EscapeURL("テキスト", System.Text.Encoding.UTF8)); |
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 LayerMask mask; | |
public void IsGrounded() | |
{ | |
if (Physics.Raycast(transform.position, Vector3.down, Mathf.Infinity, mask)) | |
{ | |
Debug.Log("RayがGroundに当たりました"); | |
} | |
} |
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
int layerMask = 1 << 8; | |
// PlayerレイヤーにあるオブジェクトとRayが相互作用するか判定します。 | |
if (Physics.Raycast(transform.position,Vector3.down,Mathf.Infinity,layerMask)) | |
{ | |
Debug.Log("RayがGroundに当たりました"); | |
} |
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
foreach (Transform child in gameObject.transform) | |
{ | |
// gameObjectの子オブジェクト(child)を操作できる | |
// 子だけで、孫(子の子)は含まれない | |
} |
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
foreach (Transform child in gameObject.transform) | |
{ | |
// gameObjectの子オブジェクト(child)を操作できる | |
// 子だけで、孫(子の子)は含まれない | |
} |
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 interface IMyButton | |
{ | |
void Press (); | |
} | |
// IMyButtonを実装したクラス | |
public class StartButton : MonoBehaviour, IMyButton | |
{ | |
public void Press () |
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 class MyButton : MonoBehaviour | |
{ | |
void Press (); | |
} | |
// MyButtonを実装したクラス | |
public class StartButton : MyButton | |
{ | |
public void Press () |
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
void LogCallBackHandler(string condition, string stackTrace, LogType type) | |
{ | |
// System.Diagnostics.StackTraceを使う | |
System.Diagnostics.StackTrace systemStackTrace = new System.Diagnostics.StackTrace(true); | |
string systemStackTraceStr = systemStackTrace.ToString(); | |
} |
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
void Awake () | |
{ | |
Application.RegisterLogCallback(LogCallBackHandler); | |
} | |
void LogCallBackHandler(string condition, string stackTrace, LogType type) | |
{ | |
// 取得したログの情報を処理する | |
} |