2026-03-28 인벤토리 90%
This commit is contained in:
26
Assets/HighlightPlus/Demo/Scripts/CreateOnTargetExample.cs
Normal file
26
Assets/HighlightPlus/Demo/Scripts/CreateOnTargetExample.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
using HighlightPlus;
|
||||
|
||||
namespace HighlightPlus.Demos {
|
||||
|
||||
public class CreateOnTargetExample : MonoBehaviour {
|
||||
|
||||
public HighlightManager manager;
|
||||
public GameObject prefab;
|
||||
|
||||
void Start () {
|
||||
manager.OnObjectClicked += OnObjectClicked;
|
||||
}
|
||||
|
||||
void OnObjectClicked (GameObject clickedGameObject, Vector3 clickPosition, Vector3 normal) {
|
||||
// Align capsule's up direction with the surface normal to make it stand upright
|
||||
Quaternion rotation = Quaternion.FromToRotation(Vector3.up, normal);
|
||||
GameObject newObject = Instantiate(prefab, clickPosition, rotation);
|
||||
newObject.name = "New Object";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14aedb8e1c5a34786a12f5c723dc5438
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/HighlightPlus/Demo/Scripts/Highlight Plus Profile.asset
LFS
Normal file
BIN
Assets/HighlightPlus/Demo/Scripts/Highlight Plus Profile.asset
LFS
Normal file
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c34c08f515ac34d2c94c916dcb2f75c2
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
17
Assets/HighlightPlus/Demo/Scripts/HighlightPlus.Demo.asmdef
Normal file
17
Assets/HighlightPlus/Demo/Scripts/HighlightPlus.Demo.asmdef
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "HighlightPlus.Demo",
|
||||
"rootNamespace": "HighlightPlus.Demos",
|
||||
"references": [
|
||||
"HighlightPlus.Runtime",
|
||||
"Unity.InputSystem"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c86ac0cf57c249eeaecacfbd096d77d
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
24
Assets/HighlightPlus/Demo/Scripts/HitFxDemo.cs
Normal file
24
Assets/HighlightPlus/Demo/Scripts/HitFxDemo.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace HighlightPlus.Demos {
|
||||
|
||||
public class HitFxDemo : MonoBehaviour {
|
||||
|
||||
public AudioClip hitSound;
|
||||
|
||||
void Update() {
|
||||
|
||||
if (!InputProxy.GetMouseButtonDown(0)) return;
|
||||
|
||||
Ray ray = Camera.main.ScreenPointToRay(InputProxy.mousePosition);
|
||||
if (Physics.Raycast(ray, out RaycastHit hitInfo)) {
|
||||
HighlightEffect effect = hitInfo.collider.GetComponent<HighlightEffect>();
|
||||
if (effect == null) return;
|
||||
AudioSource.PlayClipAtPoint(hitSound, hitInfo.point);
|
||||
effect.HitFX(hitInfo.point);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/HighlightPlus/Demo/Scripts/HitFxDemo.cs.meta
Normal file
11
Assets/HighlightPlus/Demo/Scripts/HitFxDemo.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2533fb71c5d747c58192bcd7d6cd276
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
32
Assets/HighlightPlus/Demo/Scripts/ManualSelectionDemo.cs
Normal file
32
Assets/HighlightPlus/Demo/Scripts/ManualSelectionDemo.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
using HighlightPlus;
|
||||
|
||||
namespace HighlightPlus.Demos {
|
||||
|
||||
public class ManualSelectionDemo : MonoBehaviour {
|
||||
|
||||
public HighlightManager manager;
|
||||
public Transform objectToSelect;
|
||||
|
||||
public Transform[] objectsToSelect;
|
||||
|
||||
void Update () {
|
||||
if (InputProxy.GetKeyDown("1")) {
|
||||
manager.SelectObject(objectToSelect);
|
||||
}
|
||||
if (InputProxy.GetKeyDown("2")) {
|
||||
manager.ToggleObject(objectToSelect);
|
||||
}
|
||||
if (InputProxy.GetKeyDown("3")) {
|
||||
manager.UnselectObject(objectToSelect);
|
||||
}
|
||||
if (InputProxy.GetKeyDown("4")) {
|
||||
manager.SelectObjects(objectsToSelect);
|
||||
}
|
||||
if (InputProxy.GetKeyDown("5")) {
|
||||
manager.UnselectObjects();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9dfa112658ab74560a6251002174910b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace HighlightPlus.Demos {
|
||||
|
||||
public class SimpleCharacterController : MonoBehaviour {
|
||||
public float moveSpeed = 5f;
|
||||
public float mouseSensitivity = 2f;
|
||||
public Transform playerCamera;
|
||||
private float rotationX = 0f;
|
||||
|
||||
void Start () {
|
||||
Cursor.lockState = CursorLockMode.Locked; // Locks cursor to center
|
||||
Cursor.visible = true; // Keeps cursor visible
|
||||
}
|
||||
|
||||
void Update () {
|
||||
// Movement input using WASD
|
||||
float moveX = 0f, moveZ = 0f;
|
||||
if (Input.GetKey(KeyCode.W)) moveZ = 1f;
|
||||
if (Input.GetKey(KeyCode.S)) moveZ = -1f;
|
||||
if (Input.GetKey(KeyCode.A)) moveX = -1f;
|
||||
if (Input.GetKey(KeyCode.D)) moveX = 1f;
|
||||
|
||||
Vector3 moveDirection = transform.right * moveX + transform.forward * moveZ;
|
||||
transform.position += moveDirection * moveSpeed * Time.deltaTime;
|
||||
|
||||
// Mouse look input
|
||||
float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity;
|
||||
float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity;
|
||||
|
||||
rotationX -= mouseY;
|
||||
rotationX = Mathf.Clamp(rotationX, -90f, 90f); // Prevents flipping
|
||||
|
||||
playerCamera.localRotation = Quaternion.Euler(rotationX, 0f, 0f);
|
||||
transform.Rotate(Vector3.up * mouseX);
|
||||
|
||||
// Keep cursor locked in center
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
Cursor.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e23324766795294f8e28d6407f0abc9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,40 @@
|
||||
using UnityEngine;
|
||||
using HighlightPlus;
|
||||
|
||||
namespace HighlightPlus.Demos {
|
||||
|
||||
public class SphereHighlightEventExample : MonoBehaviour {
|
||||
|
||||
HighlightEffect effect;
|
||||
|
||||
void Start() {
|
||||
effect = GetComponent<HighlightEffect> ();
|
||||
effect.OnObjectHighlightStart += ValidateHighlightObject;
|
||||
}
|
||||
|
||||
|
||||
bool ValidateHighlightObject(GameObject obj) {
|
||||
// You can return false to cancel highlight on this object
|
||||
return true;
|
||||
}
|
||||
|
||||
void HighlightStart () {
|
||||
Debug.Log ("Gold sphere highlighted!");
|
||||
}
|
||||
|
||||
void HighlightEnd () {
|
||||
Debug.Log ("Gold sphere not highlighted!");
|
||||
}
|
||||
|
||||
void Update() {
|
||||
if (InputProxy.GetKeyDown ("space")) {
|
||||
effect.HitFX (Color.white, 0.2f);
|
||||
}
|
||||
if (InputProxy.GetKeyDown("c")) {
|
||||
effect.SetGlowColor(new Color(Random.value, Random.value, Random.value));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36aa3934b8f65413188fabe723ded4da
|
||||
timeCreated: 1544692056
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,28 @@
|
||||
using UnityEngine;
|
||||
using HighlightPlus;
|
||||
|
||||
namespace HighlightPlus.Demos {
|
||||
|
||||
public class SphereSelectionEventsExample : MonoBehaviour {
|
||||
|
||||
public HighlightManager manager;
|
||||
|
||||
void Start() {
|
||||
manager.OnObjectSelected += OnObjectSelected;
|
||||
manager.OnObjectUnSelected += OnObjectUnSelected;
|
||||
}
|
||||
|
||||
bool OnObjectSelected(GameObject go) {
|
||||
Debug.Log(go.name + " selected!");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnObjectUnSelected(GameObject go) {
|
||||
Debug.Log(go.name + " un-selected!");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dbe1fcf5ef14345779fec3adb4479bc3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user