本文整理汇总了C#中Spine.Skeleton.SetSlotsToBindPose方法的典型用法代码示例。如果您正苦于以下问题:C# Skeleton.SetSlotsToBindPose方法的具体用法?C# Skeleton.SetSlotsToBindPose怎么用?C# Skeleton.SetSlotsToBindPose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spine.Skeleton
的用法示例。
在下文中一共展示了Skeleton.SetSlotsToBindPose方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SkeletonSpatial
public SkeletonSpatial(GraphicsDevice device, string contentPath, string skin)
{
if (!_registered.TryGetValue(contentPath, out _record))
_record = Load(device, contentPath);
_skeleton = new Skeleton(_record.Data);
_skeleton.SetSkin(skin);
_skeleton.SetSlotsToBindPose();
}
示例2: LoadContent
protected override void LoadContent()
{
skeletonRenderer = new SkeletonRenderer(GraphicsDevice);
String name = "spineboy"; // "goblins";
Atlas atlas = new Atlas("data/" + name + ".atlas", new XnaTextureLoader(GraphicsDevice));
SkeletonJson json = new SkeletonJson(atlas);
skeleton = new Skeleton(json.ReadSkeletonData("data/" + name + ".json"));
if (name == "goblins") skeleton.SetSkin("goblingirl");
skeleton.SetSlotsToBindPose(); // Without this the skin attachments won't be attached. See SetSkin.
// Define mixing between animations.
AnimationStateData stateData = new AnimationStateData(skeleton.Data);
if (name == "spineboy") {
stateData.SetMix("walk", "jump", 0.2f);
stateData.SetMix("jump", "walk", 0.4f);
}
state = new AnimationState(stateData);
state.SetAnimation("walk", false);
state.AddAnimation("jump", false);
state.AddAnimation("walk", true);
skeleton.RootBone.X = 320;
skeleton.RootBone.Y = 440;
skeleton.UpdateWorldTransform();
}
示例3: LoadContent
public void LoadContent(ContentManager content, GraphicsDevice graphicsDevice)
{
blankTex = content.Load<Texture2D>("blank");
skeletonRenderer = new SkeletonRenderer(graphicsDevice);
Atlas atlas = new Atlas(graphicsDevice, Path.Combine(content.RootDirectory, "spinegirl.atlas"));
SkeletonJson json = new SkeletonJson(atlas);
skeleton = new Skeleton(json.readSkeletonData("spinegirl", File.ReadAllText(Path.Combine(content.RootDirectory, "spinegirl.json"))));
skeleton.SetSkin("default");
skeleton.SetSlotsToBindPose();
Animations.Add("walk", skeleton.Data.FindAnimation("walk"));
Animations.Add("jump", skeleton.Data.FindAnimation("jump"));
Animations.Add("crawl", skeleton.Data.FindAnimation("crawl"));
Animations.Add("fall", skeleton.Data.FindAnimation("fall"));
Animations.Add("grab", skeleton.Data.FindAnimation("grab"));
Animations.Add("climb", skeleton.Data.FindAnimation("climb"));
Animations.Add("turnvalve", skeleton.Data.FindAnimation("turnvalve"));
skeleton.RootBone.X = Position.X;
skeleton.RootBone.Y = Position.Y;
skeleton.RootBone.ScaleX = Scale;
skeleton.RootBone.ScaleY = Scale;
skeleton.UpdateWorldTransform();
}
示例4: LoadContent
protected override void LoadContent()
{
skeletonRenderer = new SkeletonRenderer(GraphicsDevice);
Texture2D texture = Util.LoadTexture(GraphicsDevice, "data/goblins.png");
Atlas atlas = new Atlas("data/goblins.atlas", texture, texture.Width, texture.Height);
SkeletonJson json = new SkeletonJson(atlas);
skeleton = new Skeleton(json.ReadSkeletonData("data/goblins.json"));
skeleton.SetSkin("goblingirl");
skeleton.SetSlotsToBindPose(); // Without this the skin attachments won't be attached. See SetSkin.
animation = skeleton.Data.FindAnimation("walk");
skeleton.RootBone.X = 320;
skeleton.RootBone.Y = 440;
skeleton.UpdateWorldTransform();
}
示例5: LoadContent
protected override void LoadContent()
{
skeletonRenderer = new SkeletonRenderer(GraphicsDevice);
Atlas atlas = new Atlas(GraphicsDevice, "data/goblins.atlas");
SkeletonJson json = new SkeletonJson(atlas);
skeleton = new Skeleton(json.readSkeletonData("goblins", File.ReadAllText("data/goblins.json")));
skeleton.SetSkin("goblingirl");
skeleton.SetSlotsToBindPose();
animation = skeleton.Data.FindAnimation("walk");
skeleton.RootBone.X = 320;
skeleton.RootBone.Y = 440;
skeleton.UpdateWorldTransform();
}
示例6: LoadContent
public void LoadContent(ContentManager content, GraphicsDevice graphicsDevice)
{
blankTex = content.Load<Texture2D>("Textures/Blank");
skeletonRenderer = new SkeletonRenderer(graphicsDevice);
Atlas atlas = new Atlas(graphicsDevice, System.IO.Path.Combine(content.RootDirectory, "spineboy.atlas"));
SkeletonJson json = new SkeletonJson(atlas);
json.Scale = 0.5f;
skeleton = new Skeleton(json.readSkeletonData("spineboy", File.ReadAllText(System.IO.Path.Combine(content.RootDirectory, "spineboy.json"))));
skeleton.SetSkin("default");
skeleton.SetSlotsToBindPose();
walkAnimation = skeleton.Data.FindAnimation("walk");
jumpAnimation = skeleton.Data.FindAnimation("jump");
crawlAnimation = skeleton.Data.FindAnimation("crawl");
fallAnimation = skeleton.Data.FindAnimation("fall");
grabAnimation = skeleton.Data.FindAnimation("grab");
climbAnimation = skeleton.Data.FindAnimation("climb");
skeleton.RootBone.X = Position.X;
skeleton.RootBone.Y = Position.Y;
skeleton.UpdateWorldTransform();
}
示例7: LoadContent
protected override void LoadContent()
{
skeletonRenderer = new SkeletonRenderer(GraphicsDevice);
Atlas atlas = new Atlas("data/goblins.atlas", new XnaTextureLoader(GraphicsDevice));
SkeletonJson json = new SkeletonJson(atlas);
skeleton = new Skeleton(json.ReadSkeletonData("data/goblins.json"));
skeleton.SetSkin("goblingirl");
skeleton.SetSlotsToBindPose(); // Without this the skin attachments won't be attached. See SetSkin.
skeleton.SetAttachment("left hand item", "spear");
animation = skeleton.Data.FindAnimation("walk");
skeleton.RootBone.X = 320;
skeleton.RootBone.Y = 440;
skeleton.UpdateWorldTransform();
}
示例8: LoadContent
public void LoadContent(SkeletonRenderer sr, Texture2D bt, Atlas atlas, string json)
{
blankTex = bt;
skeletonRenderer =sr;
SkeletonJson skjson = new SkeletonJson(atlas);
skeleton = new Skeleton(skjson.readSkeletonData("robo", json));
tint = new Color(0.5f + ((float)rand.NextDouble() * 0.5f), 0.5f + ((float)rand.NextDouble() * 0.5f), 0.5f + ((float)rand.NextDouble() * 0.5f));
skeleton.R = tint.ToVector3().X;
skeleton.G = tint.ToVector3().Y;
skeleton.B = tint.ToVector3().Z;
foreach (Slot s in skeleton.Slots)
{
if (s.Data.Name != "melee-item" && s.Data.Name != "projectile-item" && s.Data.Name != "fist-item")
{
s.Data.R = skeleton.R;
s.Data.G = skeleton.G;
s.Data.B = skeleton.B;
}
}
skeleton.SetSkin("default");
skeleton.SetSlotsToBindPose();
Animations.Add("walk", skeleton.Data.FindAnimation("walk"));
Animations.Add("punch-hold", skeleton.Data.FindAnimation("punch-hold"));
Animations.Add("punch-release", skeleton.Data.FindAnimation("punch-release"));
Animations.Add("knockback", skeleton.Data.FindAnimation("knockback"));
Animations.Add("pickup", skeleton.Data.FindAnimation("pickup"));
Animations.Add("knockout", skeleton.Data.FindAnimation("knockout"));
skeleton.RootBone.X = Position.X;
skeleton.RootBone.Y = Position.Y;
skeleton.RootBone.ScaleX = Scale;
skeleton.RootBone.ScaleY = Scale;
skeleton.UpdateWorldTransform();
skeleton.FindSlot("fist-item").A = 0f;
fistSound = AudioController.effects["fist"].CreateInstance();
fistSound.IsLooped = true;
fistSound.Volume = 0f;
fistSound.Pitch = -1f;
fistSound.Play();
}
示例9: LoadContent
public void LoadContent(SkeletonRenderer sr, Atlas atlas, string json)
{
//blankTex = bt;
skeletonRenderer =sr;
SkeletonJson skjson = new SkeletonJson(atlas);
skeleton = new Skeleton(skjson.readSkeletonData("robo", json));
//skeleton.R = Tint.ToVector3().X;
//skeleton.G = Tint.ToVector3().Y;
//skeleton.B = Tint.ToVector3().Z;
Vector3 topColor = ClothesTint().ToVector3();
Vector3 bottomColor = ClothesTint().ToVector3();
Vector3 shoesColor = ClothesTint().ToVector3();
Vector3 skinColor = SkinTone().ToVector3();
Vector3 hairColor = HairColor().ToVector3();
if (IsCoPilot)
{
topColor = Color.Blue.ToVector3();
bottomColor = Color.Blue.ToVector3();
shoesColor = Color.DarkGray.ToVector3();
}
foreach (Slot s in skeleton.Slots)
{
if (s.Data.Name == "torso" ||
s.Data.Name=="arm-back-upper" ||
s.Data.Name == "arm-back-lower" ||
s.Data.Name== "arm-upper" ||
s.Data.Name =="arm-lower")
{
s.Data.R = topColor.X;
s.Data.G = topColor.Y;
s.Data.B = topColor.Z;
}
if (s.Data.Name == "leg-left" ||
s.Data.Name == "leg-right")
{
s.Data.R = bottomColor.X;
s.Data.G = bottomColor.Y;
s.Data.B = bottomColor.Z;
}
if (s.Data.Name == "foot-left" ||
s.Data.Name == "foot-right")
{
s.Data.R = shoesColor.X;
s.Data.G = shoesColor.Y;
s.Data.B = shoesColor.Z;
}
if (s.Data.Name == "head" ||
s.Data.Name == "hand" ||
s.Data.Name == "hand-copy")
{
s.Data.R = skinColor.X;
s.Data.G = skinColor.Y;
s.Data.B = skinColor.Z;
}
if (s.Data.Name == "hair")
{
s.Data.R = hairColor.X;
s.Data.G = hairColor.Y;
s.Data.B = hairColor.Z;
}
}
skeleton.SetSkin("default");
skeleton.SetSlotsToBindPose();
Animations.Add("walk", skeleton.Data.FindAnimation("walk"));
Animations.Add("punch-hold", skeleton.Data.FindAnimation("punch-hold"));
Animations.Add("punch-release", skeleton.Data.FindAnimation("punch-release"));
Animations.Add("knockback", skeleton.Data.FindAnimation("knockback"));
Animations.Add("pickup", skeleton.Data.FindAnimation("pickup"));
Animations.Add("knockout", skeleton.Data.FindAnimation("knockout"));
Animations.Add("panic", skeleton.Data.FindAnimation("panic"));
skeleton.RootBone.X = Position.X;
skeleton.RootBone.Y = Position.Y;
skeleton.RootBone.ScaleX = Scale;
skeleton.RootBone.ScaleY = Scale;
skeleton.UpdateWorldTransform();
skeleton.SetAttachment("melee-item", null);
skeleton.SetAttachment("hat", (IsCoPilot||IsPlayer)?"Pilot-Hat":null);
skeleton.SetAttachment("hair", (Helper.Random.Next(2)==0?"Hair-Male":"Hair-Female"));
skeleton.SetAttachment("chute", null);
//skeleton.FindSlot("fist-item").A = 0f;
HasParachute = false;
State = AIState.Panic;
}