added: label over hover

This commit is contained in:
Chris
2025-09-08 17:17:28 -04:00
parent 6c1cb44d18
commit f4cb569768
10 changed files with 7293 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b7f2c6caae048f64f91b54ae1442694c, type: 3}
m_Name: Test
m_EditorClassIdentifier: Core::Reset.Items.Weapon
itemName: Test Weapon
permanency: 0
essenceRequiredForPermanency: 0
weaponModel: {fileID: 0}

View File

@@ -3,4 +3,5 @@ using UnityEngine;
public interface IInteractable{
public void Interact();
public void CancelInteract();
public void OnObserverDetected(EnvironmentObserver observer);
}

View File

@@ -3,5 +3,8 @@ using UnityEngine;
namespace Reset.Items{
public class Ability : Item, IEquipable{
public NodeCanvas.Framework.Graph behaviourGraph;
public override void DrawItemInfo(Vector3 position){
throw new System.NotImplementedException();
}
}
}

View File

@@ -4,7 +4,7 @@ using UnityEngine;
namespace Reset.Items{
public abstract class Item : ScriptableObject{
public string itemName{ get; set; }
public string itemName;
public float permanency;
public float essenceRequiredForPermanency;
@@ -20,5 +20,7 @@ namespace Reset.Items{
newItemDrop.item = this;
return newItemDrop;
}
public abstract void DrawItemInfo(Vector3 position);
}
}

View File

@@ -1,4 +1,5 @@
using System;
using Drawing;
using Unity.Netcode;
using UnityEngine;
@@ -34,5 +35,11 @@ namespace Reset.Items{
public void DestroyOnOwnerRpc(){
Destroy(gameObject);
}
public void OnObserverDetected(EnvironmentObserver observer){
Draw.ingame.Label2D(transform.position + Vector3.up * 2f, item.itemName, 24);
item.DrawItemInfo(transform.position);
}
}
}

View File

@@ -1,4 +1,5 @@
using System;
using Drawing;
using NodeCanvas.StateMachines;
using UnityEngine;
@@ -11,5 +12,11 @@ namespace Reset.Items{
void Awake(){
}
public override void DrawItemInfo(Vector3 position){
Debug.Log("hiuh");
Draw.ingame.Label2D(position + Vector3.up * 1.6f, "Damage goes here");
Draw.ingame.Label2D(position + Vector3.up * 1.35f, "Speed goes here");
}
}
}

View File

@@ -127,6 +127,9 @@ public class EnvironmentObserver{
}
if (hit.transform != null) {
if (hit.transform.GetComponent<IInteractable>() != null) {
hit.transform.GetComponent<IInteractable>().OnObserverDetected(this);
}
return true;
}
}

8
Assets/_Recovery.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6d49e6609820d9e4aa40f1f0cee4bbea
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

7253
Assets/_Recovery/0.unity Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2f63ef417a19ed541ade93496467efc1
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: