void Move() { ReplayStruct value = GetComponent <ReplayContainer> ().updateValue; float vertical = value.axis.x; float horizontal = value.axis.y; float cur_speed = speed; if (value.sprint) { cur_speed *= 2; } transform.Translate(0, 0, vertical * cur_speed * Time.deltaTime); transform.Rotate(0, horizontal * rotSpeed * Time.deltaTime, 0); }
public override void UpdateReplay() { updateValue = new ReplayStruct(Input.GetAxis("Vertical"), Input.GetAxis("Horizontal"), Input.GetKey(KeyCode.LeftShift)); state.listAttribute.Add(updateValue); }