您的位置:首页 > 新闻 > 资讯 > 国外跨境电商b2b平台有哪些_永倍达电商平台_广告软文是什么意思_制作一个简单的html网页

国外跨境电商b2b平台有哪些_永倍达电商平台_广告软文是什么意思_制作一个简单的html网页

2025/1/8 19:44:16 来源:https://blog.csdn.net/LightHuiHui/article/details/144818520  浏览:    关键词:国外跨境电商b2b平台有哪些_永倍达电商平台_广告软文是什么意思_制作一个简单的html网页
国外跨境电商b2b平台有哪些_永倍达电商平台_广告软文是什么意思_制作一个简单的html网页

视频效果

请添加图片描述

代码

using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Options;public class JuanZhou : MonoBehaviour
{[SerializeField]private RawImage rawImage;[SerializeField]/// <summary>/// Padding to be applied to the masking/// X = Left/// Y = Bottom/// Z = Right/// W = Top/// </summary>private RectMask2D rectMask2D;[SerializeField]private RectTransform Left;[SerializeField]private RectTransform Right;[SerializeField]private Vector4 rectMaskTarget;[SerializeField]private float LeftX;[SerializeField]private float RightX;[SerializeField]private float duration = 2;[SerializeField]private float LeftOriX;[SerializeField]private float RightOriX;private void Update(){if (Input.GetKeyUp(KeyCode.P)){Play();}else if (Input.GetKeyUp(KeyCode.O)){Close(true);}}/// <summary>/// 设置图片/// </summary>public void SetRawImage(Texture texture){rawImage.texture = texture;}[ContextMenu("开启")]public void Play(){Play(true);}public void Play(bool Invoke = true){float tmp = Invoke ? duration : 0;Left.DOAnchorPosX(LeftX, tmp).SetEase(Ease.Linear);Right.DOAnchorPosX(RightX, tmp).SetEase(Ease.Linear);rectMask2D.DoPadding(Vector4.zero, tmp).SetEase(Ease.Linear);}[ContextMenu("关闭")]public void Close(){Close(false);}public void Close(bool Invoke = true){float tmp = Invoke ? duration : 0;Left.DOAnchorPosX(LeftOriX, tmp).SetEase(Ease.Linear);Right.DOAnchorPosX(RightOriX, tmp).SetEase(Ease.Linear);rectMask2D.DoPadding(rectMaskTarget, tmp).SetEase(Ease.Linear);}[ContextMenu("暂停")]public void Pause(){Left.DOPause();Right.DOPause();rectMask2D.DOPause();}}public static class RectMask2DExtensions
{public static TweenerCore<Vector4, Vector4, VectorOptions> DoPadding(this RectMask2D target, Vector4 endValue, float duration, bool snapping = false){TweenerCore<Vector4, Vector4, VectorOptions> t = DOTween.To(() => target.padding, x => target.padding = x, endValue, duration);t.SetOptions(snapping).SetTarget(target);return t;}
}

##请添加图片描述
卷轴预制体结构

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com