Kod ile Animasyon Kontrolü
Bu uygulamamızda asset store dan indirdiğimiz bir animasyonu kontrol etmeyi göreceğiz.
using System.Collections; using System.Collections.Generic; using UnityEngine; public class hareketler : MonoBehaviour { Animator hareket; void Start() {print("program başladı"); hareket = GetComponent<Animator>(); } void Update() {if (Input.GetKey(KeyCode.Space)) {hareket.SetTrigger("saldır");} if (Input.GetKey(KeyCode.RightArrow)) {hareket.SetTrigger("yuru");} if (Input.GetKey(KeyCode.LeftArrow)) {hareket.SetTrigger("ol");} if (Input.GetKey(KeyCode.A)) {hareket.SetTrigger("dur");} } }
Telif hakkı © 2023 | MH Themes tarafından WordPress teması
İlk yorum yapan olun