void Awake() { instance = this; trCamera = transform; trCameraRoot = transform; //gr = GameObject.Find ("Canvas").GetComponent<GraphicRaycaster>(); xzPlane = new Plane(new Vector3(0f, 1f, 0f), 0f); // set base plane to xzplane with height zero camMain = trCamera.GetComponent <Camera>(); zoomCurrent = -trCamera.localPosition.z; }
void Awake() { instance = this; gr = GameObject.Find("Canvas").GetComponent <GraphicRaycaster>(); if (InXYPlane) { xzPlane = new Plane(new Vector3(0f, 0f, 1f), 0f); } else { xzPlane = new Plane(new Vector3(0f, 1f, 0f), 0f); // set base plane to xzplane with height zero } camMain = trCamera.GetComponent <Camera>(); if (InXYPlane) { camMain.orthographicSize = zoomMax; zoomCurrent = zoomMax; } else { zoomCurrent = -trCamera.localPosition.z; } }