- Home /
Duplicate Question
Another error
Hi guys im sorry i posted this thread twice about the same thing but i voted the best answer before i got this problem.I really dont understand this errors now because it says
Assets/Scripts/Network/NetworkAnimsStates.cs(15,56): error CS0103: The name Enum' does not exist in the current context Assets/Scripts/Network/NetworkAnimsStates.cs(15,45): error CS1502: The best overloaded method match for
UnityEngine.Animation.CrossFade(string)' has some invalid arguments
Assets/Scripts/Network/NetworkAnimsStates.cs(15,45): error CS1503: Argument #1' cannot convert
object' expression to type string' Assets/Scripts/Network/NetworkAnimsStates.cs(20,43): error CS0103: The name
Enum' does not exist in the current context
Assets/Scripts/Network/NetworkAnimsStates.cs(21,27): error CS0021: Cannot apply indexing with [] to an expression of type `method group'
I dont understand it really now about arguement,enum,overloaded,indexing and stuff.I'm sorry im asking for so much help from you guys.
using UnityEngine;
using System.Collections;
public class NetworkAnimsStates : MonoBehaviour {
public Animations CurrentAnim = Animations.idle;
public GameObject ThirdPersonPlayer;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
ThirdPersonPlayer.animation.CrossFade (Enum.GetName (typeof(Animation), CurrentAnim));
}
public void SyncAnimation (string AnimName, int Speed)
{
CurrentAnim = (Animations)Enum.Parse(typeof(AnimationState), AnimName);
animation.Stop[CurrentAnim.ToString ()].Speed = Speed;
}
}
public enum Animations
{
idle,
walk,
run,
jump_pose,
}