本文整理汇总了C#中WrapMode类的典型用法代码示例。如果您正苦于以下问题:C# WrapMode类的具体用法?C# WrapMode怎么用?C# WrapMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WrapMode类属于命名空间,在下文中一共展示了WrapMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyFrom
public void CopyFrom(tk2dSpriteAnimationClip source)
{
this.name = source.name;
if (source.frames == null)
{
this.frames = null;
}
else
{
this.frames = new tk2dSpriteAnimationFrame[source.frames.Length];
for (int i = 0; i < this.frames.Length; i++)
{
if (source.frames[i] == null)
{
this.frames[i] = null;
}
else
{
this.frames[i] = new tk2dSpriteAnimationFrame();
this.frames[i].CopyFrom(source.frames[i]);
}
}
}
this.fps = source.fps;
this.loopStart = source.loopStart;
this.wrapMode = source.wrapMode;
if ((this.wrapMode == WrapMode.Single) && (this.frames.Length > 1))
{
this.frames = new tk2dSpriteAnimationFrame[] { this.frames[0] };
Debug.LogError(string.Format("Clip: '{0}' Fixed up frames for WrapMode.Single", this.name));
}
}
示例2: PicturePattern
/// <summary>
/// Creates a new PicturePattern with the specified image
/// </summary>
/// <param name="picture">The picture to draw</param>
/// <param name="wrap">The way to wrap the picture</param>
/// <param name="angle">The angle to rotate the image</param>
public PicturePattern(Image picture, WrapMode wrap, double angle)
{
_picture = picture;
_wrapMode = wrap;
_angle = angle;
_dialogFilter = "Image Files|*.bmp;*.gif;*.jpg;*.png;*.tif;*.ico";
}
示例3: TextureNative
public TextureNative(SectionHeader header, Stream stream)
: base(header, stream)
{
SectionHeader.Read(stream);
var reader = new BinaryReader(stream);
PlatformID = reader.ReadUInt32();
FilterFlags = (Filter) reader.ReadUInt16();
WrapV = (WrapMode) reader.ReadByte();
WrapU = (WrapMode) reader.ReadByte();
DiffuseName = reader.ReadString(32);
AlphaName = reader.ReadString(32);
Format = (RasterFormat) reader.ReadUInt32();
if (PlatformID == 9) {
var dxt = reader.ReadString(4);
switch (dxt) {
case "DXT1":
Compression = CompressionMode.DXT1;
break;
case "DXT3":
Compression = CompressionMode.DXT3; break;
default:
Compression = CompressionMode.None; break;
}
} else {
Alpha = reader.ReadUInt32() == 0x1;
}
Width = reader.ReadUInt16();
Height = reader.ReadUInt16();
BPP = (byte) (reader.ReadByte() >> 3);
MipMapCount = reader.ReadByte();
RasterType = reader.ReadByte();
if (RasterType != 0x4) {
throw new Exception("Unexpected RasterType, expected 0x04.");
}
if (PlatformID == 9) {
Alpha = (reader.ReadByte() & 0x1) == 0x1;
} else {
Compression = (CompressionMode) reader.ReadByte();
}
ImageDataSize = reader.ReadInt32();
ImageData = reader.ReadBytes(ImageDataSize);
if ((Format & RasterFormat.ExtMipMap) != 0) {
var tot = ImageDataSize;
for (var i = 0; i < MipMapCount; ++i) {
tot += ImageDataSize >> (2 * i);
}
ImageLevelData = reader.ReadBytes(tot);
} else {
ImageLevelData = ImageData;
}
}
示例4: Initialize
void Initialize(GraphicsPath path, WrapMode wrapMode, bool initColors, bool calcCenter) {
_texturePath = path;
_wrapMode = wrapMode;
_rectangle = path.GetBounds();
if (initColors) {
_centerColor = Color.Black;
_surroundColors = new Color []{ Color.White };
}
Bitmap texture = new Bitmap( (int)_rectangle.Width, (int)_rectangle.Height );
Graphics g = Graphics.FromImage( texture );
PointF [] pathPoints = path.PathPoints;
if (calcCenter) {
for (int i=0; i < pathPoints.Length; i++) {
_center.X += pathPoints[i].X;
_center.Y += pathPoints[i].Y;
}
_center.X /= pathPoints.Length;
_center.Y /= pathPoints.Length;
}
int outerColor = 0;
DrawSector( g, CenterPoint, pathPoints[pathPoints.Length-1], pathPoints[0], CenterColor, SurroundColors[outerColor] );
for(int i=0; i < pathPoints.Length - 1; i++) {
if (outerColor < SurroundColors.Length - 1)
outerColor++;
DrawSector( g, CenterPoint, pathPoints[i], pathPoints[i+1], CenterColor, SurroundColors[outerColor] );
}
_nativeObject = new TextureBrush( texture );
}
示例5: OnSelectionChange
void OnSelectionChange()
{
//Check user selection in editor - check for folder selection
if (Selection.objects != null && Selection.objects.Length == 1)
{
if (Selection.activeObject != null && Selection.activeObject is AnimationClip)
{
AssetDatabase.StartAssetEditing();
AnimationClip selectedClip = (AnimationClip)Selection.activeObject;
AnimationClipCurveData[] curves = AnimationUtility.GetAllCurves(selectedClip);
FrameRate = selectedClip.frameRate;
legacy = selectedClip.legacy;
WrapMode = selectedClip.wrapMode;
Clipname = selectedClip.name;
int maxTime = -1;
for (int i = 0; i < curves.Count(); i++)
{
AnimationCurve curve = curves[i].curve;
for (int k = 0; k < curve.length; k++)
{
int newTime = (int)(curve.keys[k].time * selectedClip.frameRate);
maxTime = Math.Max(maxTime, newTime);
}
}
TotalOfFrames = maxTime;
AssetDatabase.StopAssetEditing();
}
}
}
示例6: TextureBrush
public TextureBrush(Image image, WrapMode wrapMode, RectangleF dstRect)
{
if (image == null)
{
throw new ArgumentNullException("image");
}
}
示例7: AddClip
public void AddClip(AnimationClip clip, string newName, float speed, WrapMode wrapMode)
{
if (GetAnimationData(newName) != null) Debug.LogWarning("An animation with the name '" + newName + "' already exists.");
LegacyAnimationData animData = new LegacyAnimationData();
animData.clip = (AnimationClip)Instantiate(clip);
if (wrapMode == WrapMode.Default) wrapMode = animator.wrapMode;
animData.clip.wrapMode = wrapMode;
animData.clip.name = newName;
animData.clipName = newName;
animData.speed = speed;
animData.originalSpeed = speed;
animData.length = clip.length;
animData.wrapMode = wrapMode;
List<LegacyAnimationData> animationDataList = new List<LegacyAnimationData>(animations);
animationDataList.Add(animData);
animations = animationDataList.ToArray();
animator.AddClip(clip, newName);
animator[newName].speed = speed;
animator[newName].wrapMode = wrapMode;
foreach (AnimationState animState in animator) {
if (animState.name == newName) animData.animState = animState;
}
}
示例8: Animate
/// <summary>
/// Animate the Avatar
/// </summary>
/// <param name="animation">The Animation Name</param>
/// <param name="action">0 - To play the animation, 1 - to stop the animation</param>
/// <param name="wrapMode">Wrap Mode</param>
/// <param name="animationSpeed">Animation Speed</param>
/// <param name="layer">Animation Layer</param>
public void Animate(string animation, AnimationAction action, WrapMode wrapMode, float animationSpeed, int layer)
{
if (characterObject != null && animation != "")
{
if (generator.AnimationClips.Contains(animation) && characterObject.animation != null)
{
if (action == AnimationAction.Play)
{
characterObject.animation[animation].layer = layer;
characterObject.animation[animation].speed = animationSpeed;
characterObject.animation[animation].wrapMode = wrapMode;
characterObject.animation.CrossFade(animation);
}
else
{
characterObject.animation[animation].layer = layer;
characterObject.animation.Stop(animation);
}
}
else
{
string anims = "";
foreach (AnimationState state in characterObject.animation)
{
anims = anims + state.clip.name + ", ";
}
if (PopBloopSettings.useLogs)
{
Debug.LogWarning("Animation " + animation + " not found on Character " + this.gameObject.name + " => Anims found : " + anims);
}
}
}
}
示例9: Blend
/// <summary>
/// 骨骼融合播放动作
/// </summary>
/// <param name="name"></param>
public bool Blend(string name, WrapMode wrap, float speed)
{
if (this.m_cAnimation != null)
{
if (this.m_cAnimation[name] != null)
{
this.m_strCurrentAni = name;
this.m_fTime = this.m_delGetTime();
this.m_eWrap = wrap;
this.m_fSpeed = speed;
this.m_cAnimation[name].speed = speed * this.m_fScale;
this.m_cAnimation[name].wrapMode = wrap;
this.m_cAnimation.Blend(name);
return true;
}
return false;
}
else
{
this.m_strCurrentAni = "";
this.m_fTime = this.m_delGetTime();
this.m_eWrap = wrap;
this.m_fSpeed = speed;
return false;
}
return false;
}
示例10: AbstractAction
public AbstractAction(GameObject actor)
{
this.actor = actor;
state = actor.GetComponent(typeof(CharacterState)) as CharacterState;
animator = actor.GetComponent(typeof(CharacterAnimator)) as CharacterAnimator;
mover = actor.GetComponent(typeof(CharacterMover)) as CharacterMover;
actionRunner = actor.GetComponent(typeof(ActionRunner)) as ActionRunner;
animationName = null;
wrapMode = WrapMode.Once;
emotionBodyParts = Emotion.BodyParts.NONE;
canStartDialogueWithPC = true;
canStartDialogueWithAgents = true;
canEndAnyTime = true;
//canCancelDuringMovement = true;
quickReaction = null;
moveToAction = null;
started = false;
endedASAP = false;
endNextRound = false;
finished = false;
}
示例11: StartAnimation
public void StartAnimation(BasicAnimationType basicAnimationType, WrapMode wrapMode, bool playAgain)
{
if (m_CurrAnim == BasicAnimations[(int)basicAnimationType] && !playAgain)
return;
StartAnimation(basicAnimationType, wrapMode);
}
示例12: setWrapMode
public bool setWrapMode(WrapMode wrapMode)
{
if(this.wrapMode != wrapMode) {
this.wrapMode = wrapMode;
return true;
}
return false;
}
示例13: CreateSpline
private void CreateSpline (WrapMode wrapMode)
{
_curveX = new AnimationCurve();
_curveY = new AnimationCurve();
_curveZ = new AnimationCurve();
SetWrapMode(wrapMode);
}
示例14: LesserAnimationClass
public LesserAnimationClass(string animationName, float animationSpeed, WrapMode wrapMode, float crossFade, string stateName)
{
name = animationName;
speed = animationSpeed;
wrap = wrapMode;
crossfade = crossFade;
state = stateName;
}
示例15: Clear
public void Clear()
{
this.name = string.Empty;
this.frames = new tk2dSpriteAnimationFrame[0];
this.fps = 30f;
this.loopStart = 0;
this.wrapMode = WrapMode.Loop;
}