void Start() { trans = GetComponent <TransformSpherical>(); nextAction = 0; solidType = Solid.White; Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; }
void OnPreRender() { TransformSpherical trans = GetComponent <TransformSpherical>(); Shader.SetGlobalMatrix("_View", trans.worldToLocal.Matrix()); Camera cam = Camera.main; // Note that z_far is negative! Shader.SetGlobalMatrix("_Projection", GL.GetGPUProjectionMatrix(Matrix4x4.Perspective(cam.fieldOfView, cam.aspect, 0.01f, -0.01f), false)); }
void Start() { colls = new List <BallColliderSpherical>(GetComponents <BallColliderSpherical>()); trans = GetComponent <TransformSpherical>(); }