This commit is contained in:
CortexCore
2023-10-20 19:31:12 +08:00
parent 5cd094ed9a
commit a160813262
1878 changed files with 630581 additions and 4485 deletions

View File

@@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MeshCombineStudio
{
public class SimpleMove : MonoBehaviour
{
public Vector3 rotDirMulti = Vector3.one;
public float moveMulti = 50;
public float rotMulti = 50;
Vector3 dir;
float t;
void Start()
{
dir = Random.onUnitSphere;
t = Random.value * moveMulti;
}
void Update()
{
float v = Mathf.Sin(Time.time + t) * moveMulti;
if (moveMulti != 0) transform.Translate(dir * v * Time.deltaTime, Space.World);
transform.Rotate(Vector3.Scale(dir, rotDirMulti) * Time.deltaTime * rotMulti, Space.Self);
}
}
}