All right, I have a Capsule with rigidbody and a c# script “Walk”.
Inside walk, I want to make a public class whose contents can be edited in the Inspector.
It goes like this :
using UnityEngine;
using System.Collections;
public class Walk : MonoBehaviour {
public AnimationClip walk;
[System.Serializable]
public class Props {
public float maxSpeed;
}
Animation _animator;
// Use this for initialization
void Start () {
_animator = gameObject.GetComponent();
}
// Update is called once per frame
void Update () {
if (Input.GetAxis("Vertical") == 1){
rigidbody.AddRelativeForce(transform.forward *100);
_animator.CrossFade (walk.name);
}
}
}
However, neither the class nor the contents show up in the Inspector. Can anyone help?