Синтаксис:
Используется csharp
using UnityEngine;
using System.Collections;
public class CamRectView : MonoBehaviour {
Rect r = new Rect(0,Screen.height-200, 200, 200);
// Use this for initialization
void Start () {
transform.camera.pixelRect = r;
Debug.Log(r);
}
// Update is called once per frame
void Update () {
}
}
using System.Collections;
public class CamRectView : MonoBehaviour {
Rect r = new Rect(0,Screen.height-200, 200, 200);
// Use this for initialization
void Start () {
transform.camera.pixelRect = r;
Debug.Log(r);
}
// Update is called once per frame
void Update () {
}
}
и выводит он Viewport в нулевых координатах экрана,хотя так не должно быть.
Если вместо Screen.height-200 указать просто число, то все работает. В чем может быть косяк???