• Runtimes
  • help!!! UNITY error

  • Düzenlendi
Related Discussions
...

Hello everybody! I'm Newby, but it is serious! !

Since I'm using the Javascript of Unity, C # do not know!!!
In addition, I do not know English!!Thanks!!!!!!
I have stumbled code rudimentary few days!!thanks!!!!

This code, I wrote a test in order to stop the animation of Spine-tk2d> example> spineboy.

using UnityEngine;
using System.Collections;
using Spine;
using System;
public class Stop : MonoBehaviour {
private AnimationState state;
private SkeletonAnimation skeletonAnimation;
// Use this for initialization
void Start () {

skeletonAnimation = GetComponent<SkeletonAnimation>();

skeletonAnimation.state = new AnimationState(stateData);
}

// Update is called once per frame
void Update () {
skeletonAnimation.state.update(delta);
}

}

Errors Occur.

Assets/Spine/spine-tk2d/Assets/examples/spineboy/Stop.cs(6,17): error CS0104: AnimationState' is an ambiguous reference betweenUnityEngine.AnimationState' and `Spine.AnimationState'

Forum has repeatedly search.
Reference Topic

can I solve?

private Spine.AnimationState state;

It was not this way of writing is meaningless ...

Help Me
Thank you. :handshake:

You can try

....
// Update is called once per frame
if (somethingTrue)
    skeletonAnimation.state.update(delta);
}
}

Edit:
Actually, dont 😃 Pharan saves the day.

  • Düzenlendi

(1)
skeletonAnimation.state = new AnimationState(stateData);
Remove this line.

(2)
skeletonAnimation.state.update(delta);
Also remove this line.

(3)
private Spine.AnimationState state;
This is correct.

(4)
What is this script for? It doesn't seem to do anything.

Thank you, Shiu&Pharan!!
Although the result differed from what was desired,
I was able to escape from the error anyhow!!!!!! :rofl:

Finally, the code written by me is like this.

using UnityEngine;
using System.Collections;
using Spine;
using System;
public class Stop : MonoBehaviour {
   public Spine.AnimationState state;
   public SkeletonAnimation skeletonAnimation;
float delta=3.0f;

   void Start (){
      skeletonAnimation = GetComponent<SkeletonAnimation>();

   }
   void Update(){
   if (Input.GetKey("a")) {
             skeletonAnimation.state.Update(delta);
      }
   }

}

pharan
MonoBehaviour...If it deletes...

error CS0103: The name `GetComponent' does not exist in the current context

About Runtimes fundamental structure, I study henceforth.

Thank you very very much! :handshake: