本文整理汇总了C#中UVAnimation.BuildFromFile方法的典型用法代码示例。如果您正苦于以下问题:C# UVAnimation.BuildFromFile方法的具体用法?C# UVAnimation.BuildFromFile怎么用?C# UVAnimation.BuildFromFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UVAnimation
的用法示例。
在下文中一共展示了UVAnimation.BuildFromFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitAffectors
protected ArrayList InitAffectors(EffectNode node)
{
ArrayList AffectorList = new ArrayList();
if (UVAffectorEnable)
{
UVAnimation uvAnim = new UVAnimation();
Texture t = Vertexpool.GetMaterial().GetTexture("_MainTex");
if (UVType == 2)
{
uvAnim.BuildFromFile(EanPath, EanIndex, UVTime, t);
OriLowerLeftUV = uvAnim.frames[0];
OriUVDimensions = uvAnim.UVDimensions[0];
}
else if (UVType == 1)
{
float perWidth = t.width / Cols;
float perHeight = t.height / Rows;
Vector2 cellSize = new Vector2(perWidth / t.width, perHeight / t.height);
Vector2 start = new Vector2(0f, 1f);
uvAnim.BuildUVAnim(start, cellSize, Cols, Rows, Cols * Rows);
OriLowerLeftUV = start;
OriUVDimensions = cellSize;
OriUVDimensions.y = -OriUVDimensions.y;
}
if (uvAnim.frames.Length == 1)
{
OriLowerLeftUV = uvAnim.frames[0];
OriUVDimensions = uvAnim.UVDimensions[0];
}
else
{
uvAnim.loopCycles = LoopCircles;
Affector aft = new UVAffector(uvAnim, UVTime,node);
AffectorList.Add(aft);
}
}
if (RotAffectorEnable && RotateType != RSTYPE.NONE)
{
Affector aft;
if (RotateType == RSTYPE.CURVE)
aft = new RotateAffector(RotateCurve,node);
else
aft = new RotateAffector(DeltaRot,node);
AffectorList.Add(aft);
}
if (ScaleAffectorEnable && ScaleType != RSTYPE.NONE)
{
Affector aft;
if (ScaleType == RSTYPE.CURVE)
aft = new ScaleAffector(ScaleXCurve,ScaleYCurve,node);
else
aft = new ScaleAffector(DeltaScaleX, DeltaScaleY,node);
AffectorList.Add(aft);
}
if (ColorAffectorEnable && ColorAffectType != 0)
{
ColorAffector aft;
if (ColorAffectType == 2)
{
Color[] carr = new Color[4];
carr[0] = Color1; carr[1] = Color2; carr[2] = Color3; carr[3] = Color4;
aft = new ColorAffector(carr,ColorGradualTimeLength,ColorGradualType,node);
}
else
{
Color[] carr = new Color[2];
carr[0] = Color1; carr[1] = Color2;
aft = new ColorAffector(carr,ColorGradualTimeLength,ColorGradualType,node);
}
AffectorList.Add(aft);
}
if (LinearForceAffectorEnable)
{
Affector aft = new LinearForceAffector(LinearForce.normalized * LinearMagnitude,node);
AffectorList.Add(aft);
}
if (JetAffectorEnable)
{
Affector aft = new JetAffector(JetMin,JetMax,node);
AffectorList.Add(aft);
}
if (VortexAffectorEnable)
{
Affector aft;
if (UseVortexCurve)
aft = new VortexAffector(VortexCurve, VortexDirection,node);
else
aft = new VortexAffector(VortexMag, VortexDirection,node);
AffectorList.Add(aft);
}
if (AttractionAffectorEnable)
{
Affector aft ;
if (UseVortexCurve)
aft = new AttractionForceAffector(AttractionCurve, AttractionPosition,node);
else
//.........这里部分代码省略.........