public
1{ 2 private RawImage cameraImage; 3 private WebCamTexture webCamTexture; 4 private AspectRatioFitter aspectRatioFitter; 5 6 void Awake() 7 { 8 cameraImage = GetComponent<RawImage>(); 9 aspectRatioFitter = GetComponent<AspectRatioFitter>(); 10 } 11 12 void Start() 13 { 14 webCamTexture = new WebCamTexture(Screen.currentResolution.width, Screen.currentResolution.height, 30); 15 cameraImage.texture = webCamTexture; 16 if (Application.platform == RuntimePlatform.IPhonePlayer) 17 { 18 cameraImage.rectTransform.localScale = new Vector3(1,-1,1); 19 } 20 webCamTexture.Play(); 21 } 22 23 private void Update() 24 { 25 if (webCamTexture?.isPlaying ?? false) 26 { 27 transform.localEulerAngles = new Vector3(0, 0, -1 * (float) webCamTexture.videoRotationAngle); 28 aspectRatioFitter.aspectRatio = (float)webCamTexture.width / (float)webCamTexture.height; 29 30 } 31 } 32} 33コード
こちらのスクリプトで
30とはどういう意味を成すのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/04 04:11
2019/07/04 04:13