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
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
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
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
// 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
// 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
void Update() | |
{ | |
// 1秒で右に10m進む | |
float speed = 10f; | |
transform.Translate(Vector3.right * speed * Time.deltaTime); | |
} |
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 Child child; | |
private IEnumerator StartPlay() | |
{ | |
child.Play(); | |
while (!child.isComplete) | |
{ | |
// childのisComplete変数がtrueになるまで待機 | |
yield return new WaitForEndOfFrame(); |
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
Host * | |
ServerAliveInterval 60 | |
Host github.com | |
Compression yes | |
Ciphers arcfour128,arcfour256,arcfour,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc |