[External] Synty Polygon 외부 에셋 패키지 추가
Ultraworked with [Sisyphus](https://github.com/code-yeonggu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
35
Assets/External/PolygonGeneric/Scripts/Generic_SimpleRotate.cs
vendored
Normal file
35
Assets/External/PolygonGeneric/Scripts/Generic_SimpleRotate.cs
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Generic_SimpleRotate : MonoBehaviour
|
||||
{
|
||||
|
||||
public bool rotX;
|
||||
public float rotXSpeed = 50f;
|
||||
public bool rotY;
|
||||
public float rotYSpeed = 50f;
|
||||
public bool rotZ;
|
||||
public float rotZSpeed = 50f;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (rotX == true)
|
||||
{
|
||||
transform.Rotate(Vector3.left * Time.deltaTime * rotXSpeed);
|
||||
}
|
||||
if (rotY == true)
|
||||
{
|
||||
transform.Rotate(Vector3.up * Time.deltaTime * rotYSpeed);
|
||||
}
|
||||
|
||||
if (rotZ == true)
|
||||
{
|
||||
transform.Rotate(Vector3.back * Time.deltaTime * rotZSpeed);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
11
Assets/External/PolygonGeneric/Scripts/Generic_SimpleRotate.cs.meta
vendored
Normal file
11
Assets/External/PolygonGeneric/Scripts/Generic_SimpleRotate.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e44ec31bdb8f41c4c95c829379ce3b6a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
31
Assets/External/PolygonGeneric/Scripts/Generic_SimpleTranslate.cs
vendored
Normal file
31
Assets/External/PolygonGeneric/Scripts/Generic_SimpleTranslate.cs
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
11
Assets/External/PolygonGeneric/Scripts/Generic_SimpleTranslate.cs.meta
vendored
Normal file
11
Assets/External/PolygonGeneric/Scripts/Generic_SimpleTranslate.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c4c6015e0d876947938b75428e3cad6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
44
Assets/External/PolygonGeneric/Scripts/Generic_WaterBob.cs
vendored
Normal file
44
Assets/External/PolygonGeneric/Scripts/Generic_WaterBob.cs
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Generic_WaterBob : MonoBehaviour
|
||||
{
|
||||
public float bobbingHeight = 0.08f; // The height the object will bob up and down
|
||||
public float bobbingSpeed = 1.5f; // The speed of the bobbing motion
|
||||
public float rotationAmount = 0.8f; // The amount of rotation applied to the object
|
||||
public bool randomOffset = true; // Determines if random offsets are applied to speed and rotation
|
||||
public Vector2 randomRange = new Vector2(0.1f, 1f); // The range for the random offset
|
||||
private Vector3 startPos;
|
||||
private Quaternion startRotation;
|
||||
|
||||
void Start()
|
||||
{
|
||||
startPos = transform.position;
|
||||
startRotation = transform.rotation; // Save the initial rotation
|
||||
|
||||
if (randomOffset)
|
||||
{
|
||||
bobbingSpeed += UnityEngine.Random.Range(randomRange.x, randomRange.y);
|
||||
rotationAmount += UnityEngine.Random.Range(randomRange.x, randomRange.y);
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
// Calculate the vertical bobbing motion
|
||||
float newY = startPos.y + Mathf.Sin(Time.time * bobbingSpeed) * bobbingHeight;
|
||||
Vector3 newPos = new Vector3(transform.position.x, newY, transform.position.z);
|
||||
transform.position = newPos;
|
||||
|
||||
// Calculate rotation offsets based on time
|
||||
float rotationX = Mathf.Sin(Time.time * bobbingSpeed * 0.5f) * rotationAmount;
|
||||
float rotationY = Mathf.Sin(Time.time * bobbingSpeed * 0.7f) * rotationAmount;
|
||||
float rotationZ = Mathf.Sin(Time.time * bobbingSpeed * 0.9f) * rotationAmount;
|
||||
|
||||
// Apply the incremental rotation as an offset to the existing rotation
|
||||
Quaternion incrementalRotation = Quaternion.Euler(rotationX, rotationY, rotationZ);
|
||||
transform.rotation = startRotation * incrementalRotation;
|
||||
}
|
||||
}
|
||||
11
Assets/External/PolygonGeneric/Scripts/Generic_WaterBob.cs.meta
vendored
Normal file
11
Assets/External/PolygonGeneric/Scripts/Generic_WaterBob.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ca21135911583c46856103ad4a8ee18
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user