2026-04-27 BGM 및 이스터에그

This commit is contained in:
2026-04-27 17:47:44 +09:00
parent 88a71e6292
commit 18d3077cc4
840 changed files with 53720 additions and 4 deletions

View File

@@ -0,0 +1,33 @@
using UnityEngine;
#if ENABLE_INPUT_SYSTEM
using UnityEngine.InputSystem;
#endif
namespace TinyGiantStudio.Text.SampleScene
{
[ExecuteAlways]
public class AutoUpdateInputSystemToSampleScene : MonoBehaviour
{
#if UNITY_EDITOR
void Awake()
{
#if ENABLE_INPUT_SYSTEM
if (!gameObject.GetComponent<PlayerInput>())
gameObject.AddComponent<PlayerInput>();
AssetSettings settings = StaticMethods.VerifySettings(null);
if (settings)
{
if (!settings.InputActionAsset)
{
settings.FindModularTextInputActionAsset();
}
gameObject.GetComponent<PlayerInput>().actions = settings.InputActionAsset;
}
#endif
}
#endif
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: ce4927af036cdd2469b459e2e1b3fea2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Modular 3D Text/Scripts/Sample Scene/AutoUpdateInputSystemToSampleScene.cs
uploadId: 877966

View File

@@ -0,0 +1,25 @@
using UnityEngine;
namespace TinyGiantStudio.Text.SampleScene
{
public class MText_SampleScene_Announcement : MonoBehaviour
{
[SerializeField] string announcement = null;
[SerializeField] Modular3DText modular3DText = null;
[SerializeField] Animator animator = null;
[SerializeField] ParticleSystem myParticleSystem = null;
void Start()
{
animator.SetTrigger("Open");
myParticleSystem.Play();
Invoke(nameof(UpdateText), 1.5f);
}
void UpdateText()
{
modular3DText.UpdateText(announcement);
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: c46dab8975bfc754e8c67c54b6e0e1e2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Modular 3D Text/Scripts/Sample Scene/MText_SampleScene_Announcement.cs
uploadId: 877966

View File

@@ -0,0 +1,95 @@
/// Created by Ferdowsur Asif @ Tiny Giant Studios
/// This code was made with the purpose of demonstration only for sample scene
/// Not optimized and not intended to be used with real projects
/// Like using camera.man and checking name string == are bad practices
using TinyGiantStudio.Text.Example;
using UnityEngine;
#if ENABLE_INPUT_SYSTEM
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.EnhancedTouch;
using Touch = UnityEngine.InputSystem.EnhancedTouch.Touch;
#endif
namespace TinyGiantStudio.Text.SampleScene
{
public class MText_SampleScene_Cursor : MonoBehaviour
{
[SerializeField] Transform crosshair = null;
[SerializeField] float rotationSpeed = 0.1f;
[SerializeField] ParticleSystem hitEffect = null;
[SerializeField] StatusToolTip statusToolTip = null;
[SerializeField] Camera myCamera;
void Awake()
{
#if ENABLE_INPUT_SYSTEM
EnhancedTouchSupport.Enable();
#endif
}
void Start()
{
Cursor.visible = false;
if (myCamera == null)
myCamera = Camera.main;
}
void Update()
{
if (!crosshair)
return;
#if ENABLE_INPUT_SYSTEM
Ray ray = myCamera.ScreenPointToRay(Pointer.current.position.ReadValue());
#else
Ray ray = myCamera.ScreenPointToRay(Input.mousePosition);
#endif
if (Physics.Raycast(ray, out RaycastHit hit, 1000))
{
crosshair.position = hit.point;
#if ENABLE_INPUT_SYSTEM
if (MouseClicked() || Tapped())
#else
if (Input.GetMouseButtonDown(0))
#endif
{
if (hit.transform.gameObject.name == "Target") ///checking name string == is bad practice. This is just for sample scene
{
int damage = Random.Range(1, 50);
int style = 0;
if (hit.transform.position.x > 0) style = 1;
else if (hit.transform.position.x < 0) style = 2;
statusToolTip.ShowToolTip("-" + damage.ToString(), style, hit.point, Quaternion.Euler(0, 0, 0), true);
float currentHealth = hit.transform.GetChild(0).gameObject.GetComponent<Slider>().CurrentValue - damage;
if (currentHealth < 0) currentHealth = 0;
hit.transform.GetChild(0).gameObject.GetComponent<Slider>().UpdateValue(currentHealth);
hitEffect.transform.position = hit.point;
hitEffect.Play();
}
}
}
crosshair.eulerAngles += new Vector3(0, rotationSpeed, 0);
}
#if ENABLE_INPUT_SYSTEM
bool MouseClicked()
{
if (Mouse.current != null)
return Mouse.current.leftButton.wasPressedThisFrame;
return false;
}
bool Tapped()
{
if (Touch.activeTouches.Count > 0)
return Touch.activeTouches[0].ended;
return false;
}
#endif
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 258666f08c10b544190e10197eaa413e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Modular 3D Text/Scripts/Sample Scene/MText_SampleScene_Cursor.cs
uploadId: 877966

View File

@@ -0,0 +1,42 @@
using System.Collections.Generic;
using UnityEngine;
namespace TinyGiantStudio.Text.SampleScene
{
public class MText_SampleScene_FontTest : MonoBehaviour
{
#if MODULAR_3D_TEXT //This shouldn't be required. Adding this just in case
[SerializeField] private Modular3DText modular3DText = null;
[SerializeField] private Modular3DText fontText = null;
[Space]
[SerializeField] private List<Font> fonts = new List<Font>();
private int selectedFont = 0;
public void NextFont()
{
selectedFont++;
if (selectedFont >= fonts.Count) selectedFont = 0;
UpdateInfo();
}
public void PreviousFont()
{
selectedFont--;
if (selectedFont < 0) selectedFont = fonts.Count - 1;
UpdateInfo();
}
private void UpdateInfo()
{
modular3DText.Font = fonts[selectedFont];
fontText.Font = fonts[selectedFont];
fontText.Text = fonts[selectedFont].name;
}
#endif
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 5c7ac844023ab4942bbf981f53f262b3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Modular 3D Text/Scripts/Sample Scene/MText_SampleScene_FontTest.cs
uploadId: 877966

View File

@@ -0,0 +1,65 @@
using System.Collections.Generic;
using UnityEngine;
namespace TinyGiantStudio.Text.SampleScene
{
public class MText_SampleScene_ListTest : MonoBehaviour
{
[SerializeField] List<Transform> lists = new List<Transform>();
int selectedList = 0;
[SerializeField] int speed = 1;
float startTime = 0;
float distance = 0;
Vector3 targetPos = Vector3.zero;
Vector3 startPos = Vector3.zero;
void Start()
{
lists[selectedList].GetComponent<List>().Focus(true);
}
void Update()
{
if (distance == 0)
return;
// Distance moved equals elapsed time times speed..
float distCovered = (Time.time - startTime) * speed;
// Fraction of journey completed equals current distance divided by total distance.
float fractionOfJourney = distCovered / distance;
// Set our position as a fraction of the distance between the markers.
transform.position = Vector3.Lerp(startPos, targetPos, fractionOfJourney);
}
public void Next()
{
lists[selectedList].GetComponent<List>().Focus(false);
selectedList++;
if (selectedList >= lists.Count)
selectedList = 0;
lists[selectedList].GetComponent<List>().Focus(true);
GetPosition();
}
public void Previous()
{
selectedList--;
if (selectedList < 0)
selectedList = lists.Count - 1;
GetPosition();
}
void GetPosition()
{
targetPos = new Vector3(lists[selectedList].position.x, 0, 0);
startPos = transform.position;
// Keep a note of the time the movement started.
startTime = Time.time;
// Calculate the journey length.
distance = Vector3.Distance(startPos, targetPos);
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 70c10ca21281a8244a9f355a3d8d629b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Modular 3D Text/Scripts/Sample Scene/MText_SampleScene_ListTest.cs
uploadId: 877966

View File

@@ -0,0 +1,67 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace TinyGiantStudio.Text.SampleScene
{
[ExecuteInEditMode]
public class MText_SampleScene_ModuleTutorial : MonoBehaviour
{
[SerializeField] private SpriteRenderer spriteRenderer;
[SerializeField] private GameObject target;
[SerializeField] private Sprite pressPlaySprite;
[SerializeField] private Sprite selectTextSprite;
[SerializeField] private Sprite openModuleSprite;
[SerializeField] private Sprite addModuleSprite;
[SerializeField] private Sprite selectModuleSprite;
[SerializeField] private Sprite modifyModuleSprite;
[SerializeField] private Sprite doSameForDeleteSprite;
#if MODULAR_3D_TEXT //This shouldn't be required. Adding this just in case
private Modular3DText text;
private void Awake()
{
text = target.GetComponent<Modular3DText>();
}
private void Update()
{
if (!Application.isPlaying) //Press play
{
spriteRenderer.sprite = pressPlaySprite;
return;
}
if (!Selection.Contains(target)) //Select Target
{
spriteRenderer.sprite = selectTextSprite;
return;
}
if (text.addingModules.Count == 0)
{
spriteRenderer.sprite = addModuleSprite;
}
else if (!text.addingModules[0].module)
{
spriteRenderer.sprite = selectModuleSprite;
}
else if (text.addingModules[0].variableHolders.Length <= 2)
return;
else if (text.addingModules[0].variableHolders[1].floatValue == 0 || text.addingModules[0].variableHolders[4].boolValue == false)
{
spriteRenderer.sprite = modifyModuleSprite;
}
else
{
spriteRenderer.sprite = doSameForDeleteSprite;
}
}
#endif
}
}
#endif

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: cd65c6d940e1c974688dd1d8be8fdc54
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Modular 3D Text/Scripts/Sample Scene/MText_SampleScene_ModuleTutorial.cs
uploadId: 877966

View File

@@ -0,0 +1,157 @@
using System.Collections.Generic;
using UnityEngine;
namespace TinyGiantStudio.Text.SampleScene
{
public class MText_SampleScene_VRCam : MonoBehaviour
{
public enum RotationAxes { MouseXAndY = 0, MouseX = 1, MouseY = 2 }
public RotationAxes axes = RotationAxes.MouseXAndY;
public float sensitivityX = 15F;
public float sensitivityY = 15F;
public float minimumX = -360F;
public float maximumX = 360F;
public float minimumY = -60F;
public float maximumY = 60F;
float rotationX = 0F;
float rotationY = 0F;
readonly private List<float> rotArrayX = new List<float>();
float rotAverageX = 0F;
readonly private List<float> rotArrayY = new List<float>();
float rotAverageY = 0F;
public float frameCounter = 20;
Quaternion originalRotation;
private void Awake()
{
#if ENABLE_LEGACY_INPUT_MANAGER
#else
Debug.Log("Due to a bug, the camera controller for sample scene doesn't work with new input system. It's just for demo. Everything else works\nthis will be fixed asap. Apologies for the inconvenience.");
#endif
}
void Update()
{
if (axes == RotationAxes.MouseXAndY)
{
rotAverageY = 0f;
rotAverageX = 0f;
#if ENABLE_LEGACY_INPUT_MANAGER
rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
rotationX += Input.GetAxis("Mouse X") * sensitivityX;
#endif
rotArrayY.Add(rotationY);
rotArrayX.Add(rotationX);
if (rotArrayY.Count >= frameCounter)
{
rotArrayY.RemoveAt(0);
}
if (rotArrayX.Count >= frameCounter)
{
rotArrayX.RemoveAt(0);
}
for (int j = 0; j < rotArrayY.Count; j++)
{
rotAverageY += rotArrayY[j];
}
for (int i = 0; i < rotArrayX.Count; i++)
{
rotAverageX += rotArrayX[i];
}
rotAverageY /= rotArrayY.Count;
rotAverageX /= rotArrayX.Count;
rotAverageY = ClampAngle(rotAverageY, minimumY, maximumY);
rotAverageX = ClampAngle(rotAverageX, minimumX, maximumX);
Quaternion yQuaternion = Quaternion.AngleAxis(rotAverageY, Vector3.left);
Quaternion xQuaternion = Quaternion.AngleAxis(rotAverageX, Vector3.up);
transform.localRotation = originalRotation * xQuaternion * yQuaternion;
}
else if (axes == RotationAxes.MouseX)
{
rotAverageX = 0f;
rotationX += Input.GetAxis("Mouse X") * sensitivityX;
rotArrayX.Add(rotationX);
if (rotArrayX.Count >= frameCounter)
{
rotArrayX.RemoveAt(0);
}
for (int i = 0; i < rotArrayX.Count; i++)
{
rotAverageX += rotArrayX[i];
}
rotAverageX /= rotArrayX.Count;
rotAverageX = ClampAngle(rotAverageX, minimumX, maximumX);
Quaternion xQuaternion = Quaternion.AngleAxis(rotAverageX, Vector3.up);
transform.localRotation = originalRotation * xQuaternion;
}
else
{
rotAverageY = 0f;
rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
rotArrayY.Add(rotationY);
if (rotArrayY.Count >= frameCounter)
{
rotArrayY.RemoveAt(0);
}
for (int j = 0; j < rotArrayY.Count; j++)
{
rotAverageY += rotArrayY[j];
}
rotAverageY /= rotArrayY.Count;
rotAverageY = ClampAngle(rotAverageY, minimumY, maximumY);
Quaternion yQuaternion = Quaternion.AngleAxis(rotAverageY, Vector3.left);
transform.localRotation = originalRotation * yQuaternion;
}
}
void Start()
{
Rigidbody rb = GetComponent<Rigidbody>();
if (rb)
rb.freezeRotation = true;
originalRotation = transform.localRotation;
}
public static float ClampAngle(float angle, float min, float max)
{
angle %= 360;
if ((angle >= -360F) && (angle <= 360F))
{
if (angle < -360F)
{
angle += 360F;
}
if (angle > 360F)
{
angle -= 360F;
}
}
return Mathf.Clamp(angle, min, max);
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 103eec408da080f48bac1f67ba94335c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 247241
packageName: Modular 3D Text - In-Game 3D UI System
packageVersion: 4.9.2
assetPath: Assets/Plugins/Tiny Giant Studio/Modular 3D Text/Scripts/Sample Scene/MText_SampleScene_VRCam.cs
uploadId: 877966