暇つぶし2chat GAMEDEV
- 暇つぶし2ch993:名前は開発中のものです。
15/04/14 23:59:16.43 up6ChIpW.net
>>946
あ~、なんだろ、こういうことか?
public void OnEndDrag(PointerEventData ped) {
Debug.Log (setpos);
if ((float)Screen.height-setpos.y <= 66f) {
this.transform.position = Camera.main.ScreenToWorldPoint (new Vector3 (133.5f, (float)Screen.height-59f , basepos.z));
}
else if ((float)Screen.height-setpos.y <= 80f) {
this.transform.position = Camera.main.ScreenToWorldPoint (new Vector3(133.5f , (float)Screen.height-73f , basepos.z));
}
else if ((float)Screen.height-setpos.y <= 94f) {
this.transform.position = Camera.main.ScreenToWorldPoint (new Vector3(133.5f , (float)Screen.height-87f , basepos.z));
}
}
Screen.heightとかはAwake()とかで取得してフロートにキャストして
キャッシュしとくとかはすべきだろうな。


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch