8efdd2db33
https://assetstore.unity.com/packages/3d/characters/humanoids/fantasy/low-poly-medieval-fantasy-heroes-basic-pack-288957
32 lines
711 B
C#
32 lines
711 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Generic_SimpleTranslate : MonoBehaviour
|
|
{
|
|
public bool moveX;
|
|
public float moveXSpeed = 2f;
|
|
public bool moveY;
|
|
public float moveYSpeed = 2f;
|
|
public bool moveZ;
|
|
public float moveZSpeed = 2f;
|
|
|
|
void Update()
|
|
{
|
|
if (moveX == true)
|
|
{
|
|
transform.Translate(Vector3.left * Time.deltaTime * moveXSpeed);
|
|
}
|
|
if (moveY == true)
|
|
{
|
|
transform.Translate(Vector3.up * Time.deltaTime * moveYSpeed);
|
|
}
|
|
|
|
if (moveZ == true)
|
|
{
|
|
transform.Translate(Vector3.back * Time.deltaTime * moveZSpeed);
|
|
}
|
|
}
|
|
}
|
|
|