feat(project): refresh sample scenes and Nahida assets
This commit is contained in:
39
project/Assets/Scripts/MoveProbe.cs
Normal file
39
project/Assets/Scripts/MoveProbe.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using XCEngine;
|
||||
|
||||
namespace ProjectScripts
|
||||
{
|
||||
public sealed class MoveProbe : MonoBehaviour
|
||||
{
|
||||
public float moveSpeed = 2f;
|
||||
public float moveRange = 3f;
|
||||
|
||||
private Vector3 initialPos;
|
||||
private float currentOffset;
|
||||
private int direction = 1;
|
||||
|
||||
void Start()
|
||||
{
|
||||
initialPos = transform.position;
|
||||
currentOffset = 0f;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
currentOffset += moveSpeed * Time.deltaTime * direction;
|
||||
|
||||
if (currentOffset >= moveRange)
|
||||
{
|
||||
currentOffset = moveRange;
|
||||
direction = -1;
|
||||
}
|
||||
else if (currentOffset <= 0f)
|
||||
{
|
||||
currentOffset = 0f;
|
||||
direction = 1;
|
||||
}
|
||||
|
||||
float y = initialPos.y + currentOffset;
|
||||
transform.position = new Vector3(initialPos.x, y, initialPos.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
5
project/Assets/Scripts/MoveProbe.cs.meta
Normal file
5
project/Assets/Scripts/MoveProbe.cs.meta
Normal file
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 01e34b9e1b440ed7fb4b46a67f74235c
|
||||
folderAsset: false
|
||||
importer: DefaultImporter
|
||||
importerVersion: 7
|
||||
14
project/Assets/Scripts/RotateProbe.cs
Normal file
14
project/Assets/Scripts/RotateProbe.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using XCEngine;
|
||||
|
||||
namespace ProjectScripts
|
||||
{
|
||||
public sealed class RotateProbe : MonoBehaviour
|
||||
{
|
||||
public float rotateSpeed = 90f;
|
||||
|
||||
void Update()
|
||||
{
|
||||
transform.Rotate(new Vector3(0f, 1f, 0f), rotateSpeed * Time.deltaTime, Space.Self);
|
||||
}
|
||||
}
|
||||
}
|
||||
5
project/Assets/Scripts/RotateProbe.cs.meta
Normal file
5
project/Assets/Scripts/RotateProbe.cs.meta
Normal file
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 7edb733ec03c6bef08f65c987541be54
|
||||
folderAsset: false
|
||||
importer: DefaultImporter
|
||||
importerVersion: 7
|
||||
Reference in New Issue
Block a user