added: label over hover
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -3,4 +3,5 @@ using UnityEngine;
|
||||
public interface IInteractable{
|
||||
public void Interact();
|
||||
public void CancelInteract();
|
||||
public void OnObserverDetected(EnvironmentObserver observer);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
8
Assets/_Recovery.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d49e6609820d9e4aa40f1f0cee4bbea
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
7253
Assets/_Recovery/0.unity
Normal file
7253
Assets/_Recovery/0.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/_Recovery/0.unity.meta
Normal file
7
Assets/_Recovery/0.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f63ef417a19ed541ade93496467efc1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user