//
    static private void FindHighlightingBase(ref HighlightingBase highlightingBase)
    {
        if (highlightingBase != null)
        {
            return;
        }

        Camera camera = Camera.main;

        if (camera != null)
        {
            highlightingBase = camera.GetComponent <HighlightingBase>();
            if (highlightingBase != null)
            {
                return;
            }
        }

        Camera[] allCameras = Camera.allCameras;
        for (int i = 0, l = allCameras.Length; i < l; i++)
        {
            camera           = allCameras[i];
            highlightingBase = camera.GetComponent <HighlightingBase>();
            if (highlightingBase != null)
            {
                return;
            }
        }
    }
示例#2
0
 //
 protected virtual void OnEnable()
 {
     hb = target as HighlightingBase;
     if (null != hb)
     {
         hb.CheckInstance();
     }
 }
示例#3
0
    //
    void SetPresetSettings(Preset p)
    {
        HighlightingBase hb = FindObjectOfType <HighlightingBase>();

        if (hb == null)
        {
            return;
        }

        hb.downsampleFactor = p.downsampleFactor;
        hb.iterations       = p.iterations;
        hb.blurMinSpread    = p.blurMinSpread;
        hb.blurSpread       = p.blurSpread;
        hb.blurIntensity    = p.blurIntensity;
    }
    void SetPresetSettings(Camera cam, Preset p)
    {
        HighlightingBase hb = cam.GetComponent <HighlightingBase>();//FindObjectOfType<HighlightingBase>();

        Debug.Log("SetPresetSettings");
        if (hb == null)
        {
            Debug.Log("SetPresetSettings is null");
            return;
        }

        hb.downsampleFactor = p.downsampleFactor;
        hb.iterations       = p.iterations;
        hb.blurMinSpread    = p.blurMinSpread;
        hb.blurSpread       = p.blurSpread;
        hb.blurIntensity    = p.blurIntensity;
    }