Instantly share code, notes, and snippets.

View Scratch.cs
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class Scratch : MonoBehaviour, IPointerClickHandler, IBeginDragHandler, IDragHandler {
[SerializeField]
private Image m_Image;
private Texture2D m_TmpTexture;
private RectTransform m_ImageRT;
View file0.cs
void Start ()
{
// 実行中にManagersという名前のゲームオブジェクトを探す
var GUIMessageHelper = GameObject.Find ("Managers");
// ゲームオブジェクトに付いているコンポーネントを名前から探す
var comp = GUIMessageHelper.GetComponent ("GUIMessageHelper");
// 呼び出したいメソッドのパラメータを作る。ここではDictionary<string, string>型
var messageDic = new Dictionary<string, string>
{
{ "MapPos", transform.position.ToString()}
View BlockDto.cs
public class BlockDto : ObjectBaseDto
{
public BlockDto ()
{
}
public BlockDto (PositionDto _Position, float _SpawnTime, int _Type) : base (_Position, _SpawnTime)
{
Type = _Type;
}
View file0.txt
$ brew install caskroom/cask/brew-cask
View file0.txt
apply plugin: 'android'
...
dependencies {
...
compile 'com.google.android.gms:play-services:+'
}
View file0.txt
% node
% node -v
% which node
View file0.txt
public static Camera mainCamera;
public static float startWorldPointX;
public static float endWorldPointX;
public static float startWorldPointY;
public static float endWorldPointY;
void Start () {
View itween.cs
void OnTriggerStay(Collider other) {
ins = Instantiate(PlusMoneyPrefab) as GameObject;
Vector3 startPosition = new Vector3(startX, startY, -1);
ins.transform.parent = Respawn.transform;
ins.transform.localPosition = startPosition;
ins.transform.localScale = new Vector3(50, 50, 0);
Hashtable parameters = new Hashtable();
parameters.Add("y", startY + 80);
View center.cs
void Start () {
background = GetComponent<GUITexture>().texture;
}
void OnGUI(){
GUI.DrawTexture(new Rect(Screen.width / 2 - 128, Screen.height / 2 - 128, background.width,
background.width), background);
}
View qiita.cs
void Start () {
background = GetComponent<GUITexture>().texture;
}
void OnGUI(){
GUI.DrawTexture(new Rect(Screen.width / 2 - 128, Screen.height / 2 - 128, background.width,
background.width), background);
}