• 大小: 4.24MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-15
  • 语言: 其他
  • 标签: UGUI  

资源简介

Unity3D根据UGUI的各种特殊效果,内有Demo场景,使用简单。Unity2018.3.14f1亲测可用。

资源截图

代码片段和文件信息

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace Coffee.UIEffects
{
    public class UIEffect_Demo : MonoBehaviour
    {
        // Use this for initialization
        void Start()
        {
            GetComponentInChildren().enabled = true;
        }

        public void SetTimeScale(float scale)
        {
            Time.timeScale = scale;
        }

        public void Open(Animator anim)
        {
            // anim.GetComponentInChildren().Capture();
            anim.gameobject.SetActive(true);
            anim.SetTrigger(“Open“);
        }

        public void Close(Animator anim)
        {
            anim.SetTrigger(“Close“);
        }

        public void Capture(Animator anim)
        {
            // anim.GetComponentInChildren().Capture();
            anim.SetTrigger(“Capture“);
        }

        public void SetCanvasOverlay(bool isOverlay)
        {
            GetComponent().renderMode =
                isOverlay ? RenderMode.ScreenSpaceOverlay : RenderMode.ScreenSpaceCamera;
        }

        public void SetRenderMode(int mode)
        {
            var canvas = GetComponent();
            var cam = canvas.worldCamera;
            var pos = new Vector3(0 0 -25);
            var rot = new Vector3(0 0 0);

            if ((RenderMode) mode == RenderMode.WorldSpace)
            {
                SetRenderMode((int) RenderMode.ScreenSpaceCamera);
                canvas.renderMode = RenderMode.WorldSpace;
                pos.x = 45;
                rot.y = -20;
            }
            else
            {
                canvas.renderMode = (RenderMode) mode;
            }

            cam.transform.SetPositionAndRotation(pos Quaternion.Euler(rot));
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-06-09 05:50  UIEffect-upm\
     目录           0  2020-06-09 05:50  UIEffect-upm\.github\
     文件         731  2020-06-09 05:50  UIEffect-upm\.github\FUNDING.yml
     目录           0  2020-06-09 05:50  UIEffect-upm\.github\ISSUE_TEMPLATE\
     文件         905  2020-06-09 05:50  UIEffect-upm\.github\ISSUE_TEMPLATE\bug_report.md
     文件         717  2020-06-09 05:50  UIEffect-upm\.github\ISSUE_TEMPLATE\feature_request.md
     文件         706  2020-06-09 05:50  UIEffect-upm\.github\ISSUE_TEMPLATE\question.md
     文件           0  2020-06-09 05:50  UIEffect-upm\.releaserc
     文件       28421  2020-06-09 05:50  UIEffect-upm\CHANGELOG.md
     文件         174  2020-06-09 05:50  UIEffect-upm\CHANGELOG.md.meta
     文件        1053  2020-06-09 05:50  UIEffect-upm\LICENSE.md
     文件         178  2020-06-09 05:50  UIEffect-upm\LICENSE.md.meta
     文件       10061  2020-06-09 05:50  UIEffect-upm\README.md
     文件         174  2020-06-09 05:50  UIEffect-upm\README.md.meta
     文件         172  2020-06-09 05:50  UIEffect-upm\Resources.meta
     目录           0  2020-06-09 05:50  UIEffect-upm\Resources\
     文件       13342  2020-06-09 05:50  UIEffect-upm\Resources\Default-Transition.png
     文件        2260  2020-06-09 05:50  UIEffect-upm\Resources\Default-Transition.png.meta
     文件        1843  2020-06-09 05:50  UIEffect-upm\Resources\UIDissolve.shader
     文件         298  2020-06-09 05:50  UIEffect-upm\Resources\UIDissolve.shader.meta
     文件        8217  2020-06-09 05:50  UIEffect-upm\Resources\UIEffect.cginc
     文件         195  2020-06-09 05:50  UIEffect-upm\Resources\UIEffect.cginc.meta
     文件        2785  2020-06-09 05:50  UIEffect-upm\Resources\UIEffect.shader
     文件         195  2020-06-09 05:50  UIEffect-upm\Resources\UIEffect.shader.meta
     文件        1492  2020-06-09 05:50  UIEffect-upm\Resources\UIEffectSprite.cginc
     文件         195  2020-06-09 05:50  UIEffect-upm\Resources\UIEffectSprite.cginc.meta
     文件        1672  2020-06-09 05:50  UIEffect-upm\Resources\UIHsvModifier.shader
     文件         195  2020-06-09 05:50  UIEffect-upm\Resources\UIHsvModifier.shader.meta
     文件        1666  2020-06-09 05:50  UIEffect-upm\Resources\UIShiny.shader
     文件         195  2020-06-09 05:50  UIEffect-upm\Resources\UIShiny.shader.meta
     文件        1849  2020-06-09 05:50  UIEffect-upm\Resources\UITtransition.shader
............此处省略110个文件信息

评论

共有 条评论