Beispiel #1
0
 void state_End(Spine.AnimationState state, int trackIndex)
 {
     if (state.GetCurrent(trackIndex) + "" == "animation") {
         changeAniamtion = true;
     }
     if (state.GetCurrent(trackIndex) + "" == "animation3") {
         Destroy(this.gameObject);
     }
 }
Beispiel #2
0
 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");
     }
 }
Beispiel #3
0
 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);
     }
 }
Beispiel #4
0
 //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);
     }
 }
Beispiel #5
0
 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");
     }
 }
Beispiel #6
0
 // 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;
     }
 }
Beispiel #7
0
    // 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;
    }
Beispiel #8
0
    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;
        }
    }
Beispiel #9
0
	//Animation Finished
	public void End(Spine.AnimationState state, int trackIndex) {
		overridePlaying = true;
		Finish(state.GetCurrent(trackIndex).ToString());
	}
Beispiel #10
0
 void state_End(Spine.AnimationState state, int trackIndex)
 {
     if (state.GetCurrent(trackIndex) + "" == "tankai") {
         Destroy(this.gameObject);
     }
 }
Beispiel #11
0
    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;
            }
        }
    }
Beispiel #12
0
 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();
     //}
 }
Beispiel #13
0
    // 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;
        }
    }
Beispiel #14
0
    // 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;
            }
        }
    }
Beispiel #15
0
 // 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);
         }
     }
 }
Beispiel #16
0
 void state_End(Spine.AnimationState state, int trackIndex)
 {
     if (state.GetCurrent(trackIndex) + "" == "animation") {
         Application.LoadLevel("FightOrDie");
     }
 }
Beispiel #17
0
 public void Event(Spine.AnimationState state, int trackIndex, Spine.Event e)
 {
     Debug.Log(trackIndex + " " + state.GetCurrent(trackIndex) + ": event " + e + ", " + e.Int);
 }
Beispiel #18
0
 void state_End(Spine.AnimationState state, int trackIndex)
 {
     if (state.GetCurrent(trackIndex) + "" == "attack")
     {
         Debug.Log("Victor:I do not kown do what now,can you tel me?");
     }
 }