using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class YukoController : MonoBehaviour
{
private float moveSpeed = 0.5f;
private Animator anim;
private bool isMove = false;
// Start is called before the first frame update
void Start()
{
this.anim = this.GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
if (isMove)
{
if(this.transform.position.z >= 5)
{
//stop
this.anim.SetInteger("State", 0);
this.isMove = false;
}
else
{
this.transform.Translate(Vector3.forward * this.moveSpeed * Time.deltaTime);
Debug.Log(this.transform.position);
this.anim.SetInteger("State", 1);
}
}
}
public void MoveStart()
{
Debug.Log("Move Start!");
this.isMove = true;
}
}