当前位置: 首页>>代码示例>>C#>>正文


C# LeanTweenType类代码示例

本文整理汇总了C#中LeanTweenType的典型用法代码示例。如果您正苦于以下问题:C# LeanTweenType类的具体用法?C# LeanTweenType怎么用?C# LeanTweenType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LeanTweenType类属于命名空间,在下文中一共展示了LeanTweenType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PlayWithFadeInAt

 public void PlayWithFadeInAt(InMusicGroup musicGroup, float targetVolume, float duration, double dspTime, LeanTweenType tweenType = LeanTweenType.easeInOutQuad)
 {
     var parent = GetParent(musicGroup);
     PlayAt(parent, dspTime);
     SetVolume(parent, 0);
     Fade(parent, targetVolume, duration, tweenType, Time.time + Mathf.Max((float)(dspTime - AudioSettings.dspTime), 0));
 }
开发者ID:mhfirdausi,项目名称:VGDSix,代码行数:7,代码来源:MusicPlayer.cs

示例2: PlayWithFadeIn

 public void PlayWithFadeIn(InMusicGroup musicGroup, float targetVolume, float duration, LeanTweenType tweenType = LeanTweenType.easeInOutQuad)
 {
     var parent = GetParent(musicGroup);
     Play(parent);
     SetVolume(parent, 0);
     Fade(parent, targetVolume, duration, tweenType, Time.time);
 }
开发者ID:mhfirdausi,项目名称:VGDSix,代码行数:7,代码来源:MusicPlayer.cs

示例3: StopAll

        public void StopAll(InAudioNode node, float fadeOutTime, LeanTweenType type)
        {
            if (node.IsRootOrFolder)
            {
                Debug.LogWarning("InAudio: Cannot stop audio on \"" + node.GetName + "\" as it is a folder");
            }

            foreach (var audioNode in GOAudioNodes)
            {
                var infoList = audioNode.Value;
                if (infoList != null)
                {
                    int count = infoList.InfoList.Count;
                    for (int i = 0; i < count; i++)
                    {
                        if (infoList.InfoList[i].Node == node)
                        {
                            infoList.InfoList[i].Player.Stop();
                        }

                    }
                }

            }

        }
开发者ID:mhfirdausi,项目名称:VGDSix,代码行数:26,代码来源:InAudioEventWorker.cs

示例4: PlayConnectedTo

        public InPlayer PlayConnectedTo(GameObject controllingObject, InAudioNode audioNode, GameObject attachedTo, AudioParameters audioParameters, float fade = 0f, LeanTweenType fadeType = LeanTweenType.notUsed)
        {
            if (audioNode.IsRootOrFolder)
            {
                Debug.LogWarning("InAudio: Cannot play \""+audioNode.GetName+"\" as it is a folder");
                return null;
            }

                List<InstanceInfo> currentInstances = audioNode.CurrentInstances;
            if (!AllowedStealing(audioNode, currentInstances))
            {
                return null;
            }

            var runtimePlayer = InAudioInstanceFinder.RuntimePlayerControllerPool.GetObject();
            if (runtimePlayer == null)
            {
                Debug.LogWarning("InAudio: A pooled objected was not initialized. Try to restart play mode. If the problem persists, please submit a bug report.");
            }
            currentInstances.Add(new InstanceInfo(AudioSettings.dspTime, runtimePlayer));
            runtimePlayer.transform.parent = attachedTo.transform;
            runtimePlayer.transform.localPosition = new Vector3();
            Play(controllingObject, audioNode, runtimePlayer, fade, fadeType, audioParameters);
            return runtimePlayer;
        }
开发者ID:mhfirdausi,项目名称:VGDSix,代码行数:25,代码来源:InAudioEventWorker.cs

示例5: Fade

 public static void Fade(RectTransform trs,float alpha,float time,LeanTweenType type=LeanTweenType.linear,Action complete = null)
 {
     LTDescr d = LeanTween.alpha(trs, alpha, time).setEase(type);
     if (complete != null)
     {
         d.setOnComplete(complete);
     }
 }
开发者ID:yuu416fgx8mlight,项目名称:GGJ2016_HDS,代码行数:8,代码来源:UIActionUtility.cs

示例6: FadeIn

    public void FadeIn(float dur, LeanTweenType trans = LeanTweenType.easeInCubic, Action callback = null)
    {
        if (m_ease != null && LeanTween.isTweening(m_ease.uniqueId))
            LeanTween.cancel(m_ease.uniqueId);

        m_ease = LeanTween.value(gameObject, OnFade, m_blackScreenAlpha, 0, dur).setEase(trans);
        m_ease.onComplete = callback;

    }
开发者ID:GisleSolv,项目名称:SEP,代码行数:9,代码来源:CameraSam.cs

示例7: EnemyRotateTo

 public EnemyRotateTo(RotateToData _data)
 {
     tweenDesc = null;
     angle = _data.angle;
     time = _data.time;
     isAiming = _data.aim;
     ease = (LeanTweenType)Enum.Parse(typeof(LeanTweenType), _data.ease);
     direction = _data.direction;
 }
开发者ID:aeonphyxius,项目名称:unity_extensions,代码行数:9,代码来源:EnemyRotateTo.cs

示例8: MoveActionY

 public static void MoveActionY(CanvasGroup cg, float to, float alpha, float time, float alphatime = -1, LeanTweenType type = LeanTweenType.linear, Action complete = null)
 {
     LTRect cgrect = new LTRect();
     cgrect.alpha = cg.alpha;
     alphatime = (alphatime < 0) ? to : alphatime;
     LeanTween.alpha(cgrect, alpha, time).setEase(type);
     LTDescr d = LeanTween.moveLocalY(cg.transform.gameObject, to, time).setEase(type);
     d.setOnUpdate((float f) => { UpdateAlpha(cg, cgrect.alpha); });
     if (complete != null)
     {
         d.setOnComplete(complete);
     }
 }
开发者ID:yuu416fgx8mlight,项目名称:GGJ2016_HDS,代码行数:13,代码来源:UIActionUtility.cs

示例9: Alpha

    public static void Alpha(CanvasGroup cg,float alpha,float time,LeanTweenType type=LeanTweenType.linear,Action complete = null)
    {
        LTRect cgrect = new LTRect();
        cgrect.alpha = cg.alpha;

        LTDescr d = LeanTween.alpha(cgrect, alpha, time).setEase(type);
        d.setOnUpdate((float f) => { UpdateAlpha(cg, cgrect.alpha); });
        if (complete != null)
        {
            d.setOnComplete(complete);
        }

    }
开发者ID:yuu416fgx8mlight,项目名称:GGJ2016_HDS,代码行数:13,代码来源:UIActionUtility.cs

示例10: PlayAtPosition

        public InPlayer PlayAtPosition(GameObject controllingObject, InAudioNode audioNode, Vector3 position, AudioParameters audioParameters, float fade = 0f, LeanTweenType fadeType = LeanTweenType.notUsed)
        {
            if (audioNode.IsRootOrFolder)
            {
                Debug.LogWarning("InAudio: Cannot play \"" + audioNode.GetName + "\" as it is a folder");
                return null;
            }

            List<InstanceInfo> currentInstances = audioNode.CurrentInstances;
            if (!AllowedStealing(audioNode, currentInstances))
                return null;
            var runtimePlayer = InAudioInstanceFinder.RuntimePlayerControllerPool.GetObject();
            runtimePlayer.transform.position = position;
            currentInstances.Add(new InstanceInfo(AudioSettings.dspTime, runtimePlayer));
            Play(controllingObject, audioNode, runtimePlayer, fade, fadeType, audioParameters);
            return runtimePlayer;
        }
开发者ID:mhfirdausi,项目名称:VGDSix,代码行数:17,代码来源:InAudioEventWorker.cs

示例11: setLoopPingPong

	public LTDescr setLoopPingPong(int loops)
	{
		this.loopType = LeanTweenType.pingPong;
		this.loopCount = loops == -1 ? loops : loops * 2;
		return this;
	}
开发者ID:djfdat,项目名称:UnityTemplateProject-FolderStructure,代码行数:6,代码来源:LeanTween.cs

示例12: setRepeat

	/**
	* Set the tween to repeat a number of times.
	* @method setRepeat
	* @param {int} repeatNum:int the number of times to repeat the tween. -1 to repeat infinite times
	* @return {LTDescr} LTDescr an object that distinguishes the tween
	* @example
	* LeanTween.moveX(gameObject, 5f, 2.0f ).setRepeat( 10 ).setLoopPingPong();
	*/
	public LTDescr setRepeat(int repeat)
	{
		this.loopCount = repeat;
		if ((repeat > 1 && this.loopType == LeanTweenType.once) || (repeat < 0 && this.loopType == LeanTweenType.once))
		{
			this.loopType = LeanTweenType.clamp;
		}
		if (this.type == TweenAction.CALLBACK || this.type == TweenAction.CALLBACK_COLOR)
		{
			this.setOnCompleteOnRepeat(true);
		}
		return this;
	}
开发者ID:djfdat,项目名称:UnityTemplateProject-FolderStructure,代码行数:21,代码来源:LeanTween.cs

示例13: StopAll

    /// <summary>
    /// Stop all sounds playing with fade out time
    /// </summary>
    /// <param name="gameObject"></param>
    /// <param name="fadeOut">Time to fade out</param>
    /// <param name="fadeType">Fade type</param>
    public static void StopAll(float fadeOut, LeanTweenType fadeType)
    {
        if (instance != null)
        {
            instance._inAudioEventWorker.StopAll(fadeOut, fadeType);
        }
        else
        {
            InDebug.InstanceMissing("StopAll (fade)");
        }

    }
开发者ID:mhfirdausi,项目名称:VGDSix,代码行数:18,代码来源:InAudio.cs

示例14: PlayAtPosition

    /// <summary>
    /// Play an audio node in world space with a custom fade, attached to another game object
    /// </summary>
    /// <param name="gameObject">The game object to attach to and be controlled by</param>
    /// <param name="audioNode">The node to play</param>
    /// <param name="position">The world position to play at</param>
    /// <param name="fadeTime">How long it should take to fade in from 0 to 1 in volume</param>
    /// <param name="tweeenType">The curve of fading</param>
    /// <param name="startVolume">The starting volume</param>
    /// <param name="endVolume">The end volume</param>
    /// <param name="parameters">Parameters to set initial values directly</param>
    /// <returns>A controller for the playing node</returns>
    public static InPlayer PlayAtPosition(GameObject gameObject, InAudioNode audioNode, Vector3 position, float fadeTime, LeanTweenType tweeenType, float startVolume, float endVolume, AudioParameters parameters = null)
    {
        if (instance == null || audioNode == null || audioNode.IsRootOrFolder)
        {
            InDebug.MissingArguments("PlayAtPosition (tween specific)", gameObject, audioNode);
            return null;
        }

        InPlayer player = instance._inAudioEventWorker.PlayAtPosition(gameObject, audioNode, position, parameters);
        player.Volume = startVolume;
        LTDescr tweever = LeanTween.value(gameObject, (f, o) => { (o as InPlayer).Volume = f; }, startVolume, endVolume, fadeTime);
        tweever.onUpdateParam = player;

        tweever.tweenType = tweeenType;

        return player;
    }
开发者ID:mhfirdausi,项目名称:VGDSix,代码行数:29,代码来源:InAudio.cs

示例15: setRepeat

 /**
 * Set the tween to repeat a number of times.
 * @method setRepeat
 * @param {int} repeatNum:int the number of times to repeat the tween. -1 to repeat infinite times
 * @return {LTDescr} LTDescr an object that distinguishes the tween
 * @example
 * LeanTween.moveX(gameObject, 5f, 2.0f ).setRepeat( 10 ).setLoopPingPong();
 */
 public LTDescr setRepeat( int repeat )
 {
     this.loopCount = repeat;
     if((repeat>1 && this.loopType == LeanTweenType.once) || (repeat < 0 && this.loopType == LeanTweenType.once)){
         this.loopType = LeanTweenType.clamp;
     }
     return this;
 }
开发者ID:KittyMac,项目名称:LeanTween,代码行数:16,代码来源:LeanTween.cs


注:本文中的LeanTweenType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。