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


C# Tween.allTweenProperties方法代码示例

本文整理汇总了C#中Tween.allTweenProperties方法的典型用法代码示例。如果您正苦于以下问题:C# Tween.allTweenProperties方法的具体用法?C# Tween.allTweenProperties怎么用?C# Tween.allTweenProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tween的用法示例。


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

示例1: handleDuplicatePropertiesInTween

    /// <summary>
    /// checks for duplicate properties. if one is found and the DuplicatePropertyRuleType is set to
    /// DontAddCurrentProperty it will return true indicating that the tween should not be added.
    /// this only checks tweens that are not part of an AbstractTweenCollection
    /// </summary>
    private static bool handleDuplicatePropertiesInTween( Tween tween )
    {
        // first fetch all the current tweens with the same target object as this one
        var allTweensWithTarget = tweensWithTarget( tween.target );

        // store a list of all the properties in the tween
        var allProperties = tween.allTweenProperties();

        // TODO: perhaps only perform the check on running Tweens?

        // loop through all the tweens with the same target
        foreach( var tweenWithTarget in allTweensWithTarget )
        {
            // loop through all the properties in the tween and see if there are any dupes
            foreach( var tweenProp in allProperties )
            {
                warn( "found duplicate TweenProperty {0} in tween {1}", tweenProp, tween );

                // check for a matched property
                if( tweenWithTarget.containsTweenProperty( tweenProp ) )
                {
                    // handle the different duplicate property rules
                    if( duplicatePropertyRule == DuplicatePropertyRuleType.DontAddCurrentProperty )
                    {
                        return true;
                    }
                    else if( duplicatePropertyRule == DuplicatePropertyRuleType.RemoveRunningProperty )
                    {
                        // TODO: perhaps check if the Tween has any properties left and remove it if it doesnt?
                        tweenWithTarget.removeTweenProperty( tweenProp );
                    }

                    return false;
                }
            }
        }

        return false;
    }
开发者ID:squirr3l,项目名称:GoKit,代码行数:44,代码来源:Go.cs


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