{unity:script/memo}画面サイズを知りたい
Unity初心者の かなで がネットで調べて、実践できた知識の覚書。
基本的に自分用備忘録の為、説明不備はご了承くださいm(_ _)m
黒字:デフォルト
赤字:今回追加
青字:自己解釈(一般解釈とはかけ離れてる事に注意!)
目標:画面サイズを知りたい!それだけ
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class sample : MonoBehaviour {
// Use this for initialization
void Start () {
int aaa = Screen.width; //aaaには画面の横サイズが入る
int bbb = Screen.height; //bbbには画面の縦サイズが入る
}
// Update is called once per frame
void Update () {
}
}