Пример #1
0
 void Start()
 {
     if (!camera)
     {
         gameObject.AddComponent<Camera>();
     }
     
     instance = this;
     camera.orthographic = true;
     camera.nearClipPlane = 0;
     camera.farClipPlane = viewArea;
     camera.depth = 1;
     camera.clearFlags = CameraClearFlags.Depth;
     camera.cullingMask = 1 << gameObject.layer;
     transform.position = new Vector3(0, 0, -(viewArea/2f));
 }
Пример #2
0
    void Start()
    {
        if (!camera)
        {
            gameObject.AddComponent <Camera>();
        }

        instance             = this;
        camera.orthographic  = true;
        camera.nearClipPlane = 0;
        camera.farClipPlane  = viewArea;
        camera.depth         = 1;
        camera.clearFlags    = CameraClearFlags.Depth;
        camera.cullingMask   = 1 << gameObject.layer;
        transform.position   = new Vector3(0, 0, -(viewArea / 2f));
    }