private void OnEnable() { #if UNITY_STANDALONE_WIN if (SoftEffects.debuglog) { Debug.Log("<<<<<<<<<<<<<< SoftEffects enable - Unity Stand Alone Windows - >>>>>>>>>>>>"); } #elif UNITY_IOS if (SoftEffects.debuglog) { Debug.Log("<<<<<<<<<<<<<< SoftEffects enable - Unity IOS - >>>>>>>>>>>>"); } #elif UNITY_STANDALONE_OSX if (SoftEffects.debuglog) { Debug.Log("<<<<<<<<<<<<<< SoftEffects enable - Unity Stand Alone OSX - >>>>>>>>>>>>"); } #elif UNITY_STANDALONE_LINUX if (SoftEffects.debuglog) { Debug.Log("<<<<<<<<<<<<<< SoftEffects enable - Unity Stand Alone Linux - >>>>>>>>>>>>"); } #elif UNITY_ANDROID if (SoftEffects.debuglog) { Debug.Log("<<<<<<<<<<<<<< SoftEffects enable - Unity ANDROID - >>>>>>>>>>>>"); } #endif cb = new CBuffers(); if (faceOptions != null) { faceOptions.IsCombinedDirty = true; } AdjustTextureOnLine(); }
/// <summary> /// Create Soft Font, Soft Font Material, Soft Font Texture from SoftEffect Settings, /// </summary> /// <param name="font"></param> public override void AdjustTextureOnLine() { if (!eShader || eShader == null) { FindComputeShader(); } if (!eShader || eShader == null) { return; } if (!SoftFont || !SoftFont.material) { if (SoftEffects.debuglog) { Debug.LogError("SoftFont is missing. Create SoftFont bevore."); } return; } if (!faceOptions.mainTexture || faceOptions.mainTexture == null) { if (SoftEffects.debuglog) { Debug.LogError("Edit texture is missing. Create or rebuild."); } return; } if (cb == null) { cb = new CBuffers(); } if (gpuWorker == null) { gpuWorker = new GPUWorker(eShader); } RenderNewTextures(gpuWorker, false); //2 Set new gpu rendered texture to font GetComponent <Text>().material = null; GetComponent <Text>().material = SoftFont.material; }