예제 #1
0
        private IEnumerator ScaleOutLine(AvatarComponent m_Avatar) //by pj
        {
            while (m_Avatar != null && m_Avatar.GetToLoadCount() != 0)
            {
                yield return(null);
            }

            if (m_Character != null)
            {
                CartoonHelp.ScaleCartoonOutLine(m_Character, 0.005f);
            }
        }
예제 #2
0
        /// <summary>
        /// Bloom效果后处理接口,使用的时候必须调用
        /// </summary>
        /// <param name="uiTexture">后处理效果图片,不带原型</param>
        public void SetBloomUITexture(UITexture uiTexture)
        {
            if (Bloom == null)
            {
                Bloom = BloomCamera.gameObject.AddComponent <Bloom>();
                Bloom.thresholdGamma = Bloom.thresholdLinear = 0.99f;
                Bloom.softKnee       = 0.05f;
                Bloom.intensity      = 1;
                Bloom.radius         = 4;
                Bloom.highQuality    = false;
                Bloom.antiFlicker    = false;
            }
            if (uiTexture && BloomCamera != null)
            {
                BloomCamera.enabled = true;
                BloomCamera.gameObject.SetActive(true);
                CartoonHelp.SetCartoonBrightLight(characterCreator.mDMono.gameObject, -0.05f);

                if (BloomUiTexture == null)
                {
                    BloomUiTexture = new GameObject("BloomUiTexture").AddComponent <UITexture>();
                    BloomUiTexture.gameObject.layer = 5;
                    BloomUiTexture.transform.parent = mDMono.transform.parent;
                    BloomUiTexture.shader           = Shader.Find("Unlit/RenderTexture");
                    BloomUiTexture.SetRect(0, 0, uiTexture.localSize.x, uiTexture.localSize.y);
                    BloomUiTexture.transform.localScale    = new Vector3(1.24f, 1, 0);
                    BloomUiTexture.transform.localPosition = new Vector3(0, 0, 0);
                    BloomUiTexture.depth = uiTexture.depth + 1;
                }
                if (BloomRT == null)
                {
                    BloomRT = new RenderTexture(700, 700, 16, RenderTextureFormat.ARGB32);
                }
                BloomCamera.targetTexture    = BloomRT;
                BloomCamera.orthographicSize = 2;
                BloomUiTexture.mainTexture   = BloomRT;
            }
            else
            {
                BloomCamera.enabled = false;
            }
        }