Пример #1
0
        void OnRenderImage(RenderTexture source, RenderTexture destination)
        {
            outlineShaderMaterial.SetTexture("_OutlineSource", renderTexture);

            if (addLinesBetweenColors)
            {
                Graphics.Blit(source, extraRenderTexture, outlineShaderMaterial, 0);
                outlineShaderMaterial.SetTexture("_OutlineSource", extraRenderTexture);
            }
            Graphics.Blit(source, destination, outlineShaderMaterial, 1);

            /*
             * 仅当相机属性发生改变
             * 并且已经停止交互
             * 再重新生成可读取像素颜色的纹理
             */
            if (isChanged && !MouseButtonInteraction() && !CameraMove.IsPlay() && !TreeAnimator.IsPlaying())
            {
                RenderTex2Tex2D();      //将渲染纹理转换成可读取像素颜色的纹理

                foreach (OutlineControl control in controls)
                {
                    control.RecordColor();
                }

                isChanged = false;
            }
        }
Пример #2
0
 void IsChanged()
 {
     if (MouseButtonInteraction() || CameraMove.IsPlay() || TreeAnimator.IsPlaying())
     {
         isChanged = true;
     }
 }
Пример #3
0
 private void Update()
 {
     /*
      * 当仍处于动画中时
      * 禁止按钮可交互
      * 防止数据出现
      */
     if (TreeAnimator.IsPlaying() || CameraMove.IsPlay())
     {
         button.interactable = false;
     }
     else
     {
         button.interactable = true;
     }
 }
Пример #4
0
 public bool IsPlaying()
 {
     return(TreeAnimator.IsPlaying() || CameraMove.IsPlay());
 }