Graphics Reference
In-Depth Information
// The current x-z move speed
public float moveSpeed= 0.0f;
// The last collision flags returned from controller.Move
private CollisionFlags;
public BasePlayerManager myPlayerController;
[System.NonSerialized]
public Keyboard_Input default_input;
public float horz;
public float vert;
private CharacterController controller;
// ----------------------------------------------------------------
void Awake ()
{
// we need to do this before anything happens to the script
// or object, so it happens in Awake.
// if you need to add specific set-up, consider adding it to
// the Init() function instead to keep this function
// limited only to things we need to do before
// anything else happens.
moveDirection = transform.TransformDirection(Vector3.forward);
// if _animation has not been set up in the inspector, we'll
// try to find it on the current gameobject
if(_animation==null)
_animation = GetComponent<Animation>();
if(!_animation)
Debug.Log("The character you would like to control
doesn't have animations. Moving her might look
weird.");
if(!idleAnimation) {
_animation = null;
Debug.Log("No idle animation found. Turning off
animations.");
}
if(!walkAnimation) {
_animation = null;
Debug.Log("No walk animation found. Turning off
animations.");
}
controller = GetComponent<CharacterController>();
}
public virtual void Start ()
{
Init ();
}
Search WWH ::




Custom Search