Пример #1
0
    // Use this for initialization
    void Start()
    {
        init = true;

        //get all clickable objets
        if (clickableObjectGroup == null)
        {
            Debug.LogWarning("CameraRedBallClicker script must have a clickable object group to work.");
            init = false;
        }
        else
        {
            clickables = clickableObjectGroup.GetComponentsInChildren <Collider>();
        }

        //get the camera used for raycasting
        cam = GetComponent <Camera>();
        if (cam == null)
        {
            Debug.LogError("CameraRedBallClicker script must have a camera to work.");
            init = false;
        }
        else
        {
            //Get the advanced perspective projection tool
            cprt = GetComponent <CPRT>();

            if (cam == null)
            {
                Debug.LogError("CameraRedBallClicker script must have a CustomCameraProjection to work.");
                init = false;
            }
        }
    }
 public void Init()
 {
     if (isActiveAndEnabled && sceneCamera != null && renderRawImage != null)
     {
         cprt         = sceneCamera.GetComponent <CPRT>();
         postfxCamera = GetComponent <Camera>();
     }
 }
Пример #3
0
 private void Start()
 {
     lastTime = DateTime.Now;
     cprt     = GetComponent <CPRT>();
 }
Пример #4
0
 public void Init(CPRT _cprt)
 {
     cprt           = _cprt;
     canCallPrecull = false;
 }