本文整理汇总了C#中Spine.GetCurrent方法的典型用法代码示例。如果您正苦于以下问题:C# Spine.GetCurrent方法的具体用法?C# Spine.GetCurrent怎么用?C# Spine.GetCurrent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spine
的用法示例。
在下文中一共展示了Spine.GetCurrent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: state_End
void state_End(Spine.AnimationState state, int trackIndex)
{
if (state.GetCurrent(trackIndex) + "" == "animation") {
changeAniamtion = true;
}
if (state.GetCurrent(trackIndex) + "" == "animation3") {
Destroy(this.gameObject);
}
}
示例2: state_End
void state_End(Spine.AnimationState state, int trackIndex)
{
if (state.GetCurrent(trackIndex) + "" == "zoom_out2")
{
bgAnimationScript.state.SetAnimation(5, "stay", false);
}
if (state.GetCurrent(trackIndex) + "" == "stay")
{
Application.LoadLevel("fighting");
}
}
示例3: state_End
void state_End(Spine.AnimationState state, int trackIndex)
{
if (state.GetCurrent(trackIndex) + "" == "stay") {
m_a.state.SetAnimation(1, "zoom_in", false);
}
if (state.GetCurrent(trackIndex) + "" == "zoom_in")
{
m_a.state.SetAnimation(2, "zoom_out", false);
}
if (state.GetCurrent(trackIndex) + "" == "zoom_out")
{
m_a.state.SetAnimation(3, "stay", false);
}
}
示例4: state_End
//void state_Event(Spine.AnimationState state, int trackIndex, Spine.Event e)
//{
// if (e + "" == "zhongjian")
// {
// Debug.Log("zhongjian!");
// Instantiate(m_arrowArea, new Vector2(0, 0), Quaternion.Euler(0, 0, 0));
// return;
// }
// if (e + "" == "tankai" )
// {
// isCheckBlock = true;
// checkTime = 0.05f;
// //try
// //{
// // m_hit = Physics2D.Linecast(this.transform.position, playerObj.transform.position, 1 << LayerMask.NameToLayer("Block"));
// // if (m_hit)
// // {
// // Debug.Log("block my arrow");
// // beenBlock();
// // }
// //}
// //catch {
// // // exception
// //}
// }
//}
void state_End(Spine.AnimationState state, int trackIndex)
{
if (state.GetCurrent(trackIndex) + "" == "animation") {
Instantiate(m_arrowStand, new Vector2(4.2f , 4.7f), Quaternion.Euler(0, 0, 0));
m_audioManager.archerkill();
Destroy(this.gameObject);
}
}
示例5: state_End
void state_End(Spine.AnimationState state, int trackIndex)
{
if (state.GetCurrent(trackIndex) + "" == "zoom_out2")
{
bgAnimationScript.state.SetAnimation(5, "stay", false);
GameObject.Find("EnemyCreator").GetComponent<EnemyManager>().isPause = false;
m_TouchController.setTouchState("fight");
}
}
示例6: AnimationStartListener
// call when Spine animation START
void AnimationStartListener(Spine.AnimationState state, int trackIndex)
{
// DEBUG animation name
debug_AniName.text = state.GetCurrent(0).ToString();
drawTimelineHeight = (drawTimelineHeight == 10) ? 1:10;
switch (state.GetCurrent(0).ToString()) {
case "jump" :
animTimelineColor = Color.green;
break;
case "fall" :
animTimelineColor = Color.red;
break;
case "forward" :
animTimelineColor = Color.blue;
break;
case "dashBackward" :
animTimelineColor = Color.black;
break;
default :
animTimelineColor = Color.white;
break;
}
}
示例7: AnimationStartListener
// call when Spine animation START
void AnimationStartListener(Spine.AnimationState state, int trackIndex)
{
// DEBUG animation name
debug_AniName.text = state.GetCurrent(0).ToString();
// get current animation
currentAnimation = state.GetCurrent(trackIndex).ToString();
cancelable = false;
nonCancelableTime = Time.time + state.GetCurrent(trackIndex).time;
}
示例8: state_End
void state_End(Spine.AnimationState state, int trackIndex)
{
if(state.GetCurrent(trackIndex) + "" == "skill_touch" && isLaunchSkill){
actionNumber = 6;
attackAudioScript.skillLanding();
}
if (state.GetCurrent(trackIndex) + "" == "block2") {
actionNumber = 7;
}
if (state.GetCurrent(trackIndex) + "" == "chongsheng")
{
animationTest.loop = true;
actionNumber = 0;
playerState = "stand";
GameObject.FindGameObjectWithTag("EnemyManager").GetComponent<EnemyManager>().isPause = false;
}
}
示例9: End
//Animation Finished
public void End(Spine.AnimationState state, int trackIndex) {
overridePlaying = true;
Finish(state.GetCurrent(trackIndex).ToString());
}
示例10: state_End
void state_End(Spine.AnimationState state, int trackIndex)
{
if (state.GetCurrent(trackIndex) + "" == "tankai") {
Destroy(this.gameObject);
}
}
示例11: HandleStart
void HandleStart(Spine.AnimationState state, int trackIndex)
{
//must use first track for now
if(trackIndex != 0)
return;
rootMotionCurve = null;
rootMotionCurveY = null;
// get current animation
Spine.Animation anim = state.GetCurrent(trackIndex).Animation;
//find the root bone's translate curve
foreach(Timeline t in anim.Timelines){
if(t.GetType() != typeof(TranslateTimeline))
continue;
TranslateTimeline tt = (TranslateTimeline)t;
if(tt.boneIndex == rootBoneIndex){
//sample the root curve's X value
//TODO: cache this data? Maybe implement RootMotionTimeline instead and keep it in SkeletonData
rootMotionCurve = new AnimationCurve();
rootMotionCurveY = new AnimationCurve();
float time = 0;
float increment = 1f/30f;
int frameCount = Mathf.FloorToInt(anim.Duration / increment);
for(int i = 0; i <= frameCount; i++){
Vector2 v = GetXYAtTime(tt, time);
rootMotionCurve.AddKey(time, v.x);
rootMotionCurveY.AddKey(time, v.y);
time += increment;
}
break;
}
}
}
示例12: state_End
void state_End(Spine.AnimationState state, int trackIndex)
{
if (state.GetCurrent(trackIndex) + "" == "daojishi") {
countDownAnimation.state.SetAnimation(2, "bao", false);
}
//if (state.GetCurrent(trackIndex) + "" == "bao")
//{
// GameObject.Find("Canvas").GetComponent<CreatUISence>().ReviveTimeOut();
//}
}
示例13: AnimationStartListener
// call when Spine animation START
void AnimationStartListener(Spine.AnimationState state, int trackIndex)
{
// GET CURRENT ANIMATION
currentAnimation = state.GetCurrent(trackIndex).ToString();
cancelable = false;
// SET GRAVITY SCALE TO ZERO FOR JUMP ACTIONS
if (currentAnimation == "jump" || currentAnimation == "airJump") {
Debug.Log("GRAVITY = 0");
rigibody.gravityScale = 0;
}
}
示例14: AnimationStartListener
// call when Spine animation START
void AnimationStartListener(Spine.AnimationState state, int trackIndex)
{
//Debug.Log ("[Start]: " + state);
// GET CURRENT ANIMATION
currentAnimation = state.GetCurrent(trackIndex).ToString();
cancelable = false;
queueable = false;
queueableTime = Time.time + state.GetCurrent(trackIndex).endTime - queueDuration;
// SET isKinematic TO TRUE, SO CHARACTER WILL NOT EFFECT BY GRAVITY
if (currentAnimation == "jump" || currentAnimation == "airJump") {
rigibody.isKinematic = true;
jumpCount += 1;
if (jumpCount > 1 ) {
jumpFinish = true;
}
}
}
示例15: AnimationCompleteListener
// call when Spine animation COMPLETE
void AnimationCompleteListener(Spine.AnimationState state, int trackIndex , int loopCount)
{
lastAnimation = state.GetCurrent(trackIndex).ToString();
cancelable = true;
if (currentAnimation == "ready" || currentAnimation == "forward")
return;
//Debug.Log ("[COMPLETE]: " + state);
//Debug.Log (stateQueue.Count);
// IF NEXT STATE IS NOT EXISTS, SET TO READY STATE
if (stateQueue.Count == 0 ) {
//Debug.Log("RESET STATE TO READY WHEN ANIMATION OVER.");
if (grounded) {
ResetAnimation();
} else {
m_state = AnimState.Fall;
SetAnimation(0, "fall", true);
}
}
}