本文整理汇总了C#中com.copyValuesTo方法的典型用法代码示例。如果您正苦于以下问题:C# com.copyValuesTo方法的具体用法?C# com.copyValuesTo怎么用?C# com.copyValuesTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com
的用法示例。
在下文中一共展示了com.copyValuesTo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: resolve
public virtual void resolve(float x, float y, int chainLength, com.brashmonkey.spriter.objects.SpriterAbstractObject
effector)
{
float xx = effector.getX() + (float)System.Math.Cos(SpriterCalculator.DegreeToRadian(effector
.getAngle())) * SpriterCalculator.BONE_LENGTH * effector
.getScaleX();
float yy = effector.getY() + (float)System.Math.Sin(SpriterCalculator.DegreeToRadian(effector
.getAngle())) * SpriterCalculator.BONE_LENGTH * effector
.getScaleX();
effector.setAngle(com.brashmonkey.spriter.SpriterCalculator.angleBetween(effector
.getX(), effector.getY(), x, y));
if (this.player.getFlipX() == -1)
{
effector.setAngle(effector.getAngle() + 180f);
}
com.brashmonkey.spriter.objects.SpriterBone parent = null;
if (effector.hasParent())
{
parent = player.getRuntimeBones()[effector.getParentId()];
effector.copyValuesTo(temp);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, temp);
if (effector is com.brashmonkey.spriter.objects.SpriterBone)
{
temp.copyValuesTo(player.lastFrame.getBones()[effector.getId()]);
}
else
{
temp.copyValuesTo(player.lastFrame.getObjects()[effector.getId()]);
}
}
for (int i = 0; i < chainLength && parent != null; i++)
{
if (com.brashmonkey.spriter.SpriterCalculator.distanceBetween(xx, yy, x, y) <= 1)
{
return;
}
parent.setAngle(parent.getAngle() + com.brashmonkey.spriter.SpriterCalculator.angleDifference
(com.brashmonkey.spriter.SpriterCalculator.angleBetween(parent.getX(), parent.getY
(), x, y), com.brashmonkey.spriter.SpriterCalculator.angleBetween(parent.getX(),
parent.getY(), xx, yy)));
this.player.updateRecursively(parent);
if (parent.hasParent())
{
parent = player.getRuntimeBones()[parent.getParent().getId()];
}
else
{
parent = null;
}
xx = effector.getX() + (float)System.Math.Cos(SpriterCalculator.DegreeToRadian(effector.getAngle
())) * SpriterCalculator.BONE_LENGTH * effector.getScaleX
();
yy = effector.getY() + (float)System.Math.Sin(SpriterCalculator.DegreeToRadian(effector.getAngle
())) * SpriterCalculator.BONE_LENGTH * effector.getScaleX
();
}
}
示例2: updateBone
protected internal override void updateBone(com.brashmonkey.spriter.objects.SpriterBone
bone)
{
base.updateBone(bone);
bone.copyValuesTo(temp);
com.brashmonkey.spriter.objects.SpriterAbstractObject parent = (bone.hasParent())
? getRuntimeBones()[bone.getParent().getId()] : this.tempParent;
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, temp);
temp.copyValuesTo(this.lastFrame.getBones()[temp.getId()]);
}
示例3: tweenBone
private void tweenBone(com.brashmonkey.spriter.objects.SpriterBone currentBone, com.brashmonkey.spriter.objects.SpriterBone
nextBone, int i, long startTime, long endTime)
{
currentBone.copyValuesTo(this.tempBones[i]);
this.tempBones[i].setTimeline((nextBone != null) ? currentBone.getTimeline() : -1
);
com.brashmonkey.spriter.objects.SpriterAbstractObject parent = (this.tempBones[i]
.hasParent()) ? this.tempBones[this.tempBones[i].getParentId()] : this.tempParent;
if (nextBone != null)
{
if (parent != this.tempParent)
{
if (!currentBone.getParent().equals(nextBone.getParent()))
{
nextBone = (com.brashmonkey.spriter.objects.SpriterBone)this.getTimelineObject(currentBone
, this.tempBones2);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, nextBone);
nextBone.setAngle(nextBone.getAngle() * this.flippedX * this.flippedY);
}
}
else
{
if (nextBone.hasParent())
{
nextBone = (com.brashmonkey.spriter.objects.SpriterBone)this.getTimelineObject(currentBone
, this.tempBones2);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, nextBone);
nextBone.setAngle(nextBone.getAngle() * this.flippedX * this.flippedY);
}
}
if (this.tempBones[i].tween)
{
this.interpolateAbstractObject(this.tempBones[i], currentBone, nextBone, startTime
, endTime);
}
}
this.moddedBones[currentBone.getId()].modSpriterBone(this.tempBones[i]);
if (this.transitionFixed)
{
this.tempBones[i].copyValuesTo(this.lastFrame.getBones()[i]);
}
else
{
this.tempBones[i].copyValuesTo(this.lastTempFrame.getBones()[i]);
}
if (!this.tempBones[i].hasParent() || !this.moddedBones[currentBone.getId()].isActive
())
{
this.tempBones[i].setX(this.tempBones[i].getX() + this.pivotX);
this.tempBones[i].setY(this.tempBones[i].getY() + this.pivotY);
}
this.translateRelative(this.tempBones[i], parent);
}
示例4: updateTransformedTempObject
private void updateTransformedTempObject(com.brashmonkey.spriter.objects.SpriterAbstractObject
source, com.brashmonkey.spriter.objects.SpriterAbstractObject target)
{
source.copyValuesTo(target);
if (!target.hasParent())
{
target.setX(target.getX() + this.pivotX);
target.setY(target.getY() + this.pivotY);
}
this.translateRelative(target, (target.hasParent()) ? this.tempBones2[target.getParentId
()] : this.tempParent);
}
示例5: updateTempObject
private void updateTempObject(com.brashmonkey.spriter.objects.SpriterAbstractObject
source, com.brashmonkey.spriter.objects.SpriterAbstractObject[] target)
{
bool found = false;
for (int j = 0; j < target.Length && !found; j++)
{
if (source.getId() == target[j].getId())
{
source.copyValuesTo(target[j]);
found = true;
}
}
}
示例6: tweenObject
private void tweenObject(com.brashmonkey.spriter.objects.SpriterObject currentObject
, com.brashmonkey.spriter.objects.SpriterObject nextObject, int i, long startTime
, long endTime)
{
com.brashmonkey.spriter.draw.DrawInstruction dI = this.instructions[i];
currentObject.copyValuesTo(this.tempObjects[i]);
com.brashmonkey.spriter.objects.SpriterAbstractObject parent = null;
if (!currentObject.isTransientObject())
{
this.tempObjects[i].setTimeline((nextObject != null) ? currentObject.getTimeline(
) : -1);
parent = (currentObject.hasParent()) ? this.tempBones[currentObject.getParentId()
] : this.tempParent;
if (nextObject != null)
{
if (parent != this.tempParent)
{
if (!currentObject.getParent().equals(nextObject.getParent()))
{
nextObject = (com.brashmonkey.spriter.objects.SpriterObject)this.getTimelineObject
(currentObject, this.tempObjects2);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, nextObject);
nextObject.setAngle(nextObject.getAngle() * this.flippedX * this.flippedY);
}
}
else
{
if (nextObject.hasParent())
{
nextObject = (com.brashmonkey.spriter.objects.SpriterObject)this.getTimelineObject
(currentObject, this.tempObjects2);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, nextObject);
nextObject.setAngle(nextObject.getAngle() * this.flippedX * this.flippedY);
}
}
if (this.tempObjects[i].tween)
{
this.interpolateSpriterObject(this.tempObjects[i], currentObject, nextObject, startTime
, endTime);
}
}
this.moddedObjects[currentObject.getId()].modSpriterObject(this.tempObjects[i]);
if (this.transitionFixed)
{
this.tempObjects[i].copyValuesTo(this.lastFrame.getObjects()[i]);
}
else
{
this.tempObjects[i].copyValuesTo(this.lastTempFrame.getObjects()[i]);
}
}
else
{
parent = this.tempParent;
}
if (!this.tempObjects[i].hasParent())
{
this.tempObjects[i].setX(this.tempObjects[i].getX() + this.pivotX);
this.tempObjects[i].setY(this.tempObjects[i].getY() + this.pivotY);
}
this.translateRelative(this.tempObjects[i], parent);
if (this.moddedObjects[currentObject.getId()].getRef() != null)
{
this.tempObjects[i].setRef(this.moddedObjects[currentObject.getId()].getRef());
}
/*if (this.moddedObjects[currentObject.getId()].getLoader() != null)
{
this.tempObjects[i].setLoader(this.moddedObjects[currentObject.getId()].getLoader
());
}*/
this.tempObjects[i].copyValuesTo(dI);
this.setInstructionRef(dI, this.tempObjects[i], nextObject);
}