void OnEnable() { if (mainCamera == null) { mainCamera = Camera.main; } // ensure the SpriteLightKitPostProcessor is on the Camera _slkImageEffect = mainCamera.GetComponent <SpriteLightKitImageEffect>(); if (_slkImageEffect == null) { _slkImageEffect = mainCamera.gameObject.AddComponent <SpriteLightKitImageEffect>(); } prepareCamera(); updateTexture(); transform.localPosition = Vector3.zero; }
void OnEnable() { if( mainCamera == null ) mainCamera = Camera.main; // ensure the SpriteLightKitPostProcessor is on the Camera _slkImageEffect = mainCamera.GetComponent<SpriteLightKitImageEffect>(); if( _slkImageEffect == null ) _slkImageEffect = mainCamera.gameObject.AddComponent<SpriteLightKitImageEffect>(); prepareCamera(); updateTexture(); transform.localPosition = Vector3.zero; }