Home > other >  People walk around the flash
People walk around the flash

Time:09-29


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

Public class Cilpcontrol: MonoBehaviour
{
Animator anim.


//Start is called before the first frame update
Void the Start ()
{
Anim=GetComponent ();
}

//Update is called once per frame
Void the Update ()
{
If (Input. GetKeyDown (KeyCode. A))
{
Anim. SetFloat (" speed ", 2 f);
}
If (Input. GetKeyUp (KeyCode. A))
{
Anim. SetFloat (" speed ", 0 f);
}
If (Input. GetKeyDown (KeyCode. D))
{
Anim. SetFloat (" speed ", 2 f);
}
If (Input. GetKeyUp (KeyCode. D))
{
Anim. SetFloat (" speed ", 0 f);
}

}
}
//cilpControl
  • Related