12 changed files with 73 additions and 5 deletions
@ -0,0 +1,8 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: fa069fdb6941fa247b6d3ca2cfcc0307 |
||||
|
folderAsset: yes |
||||
|
DefaultImporter: |
||||
|
externalObjects: {} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
@ -0,0 +1,24 @@ |
|||||
|
using System; |
||||
|
using System.Collections; |
||||
|
using System.Collections.Generic; |
||||
|
using TMPro; |
||||
|
using UnityEngine; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// This class' only purpose is to set the name of an item view prototype. Could be the item itself, or the infobox, or anything!
|
||||
|
/// </summary>
|
||||
|
[RequireComponent(typeof(TextMeshProUGUI))] |
||||
|
public class ItemNameDisplay : MonoBehaviour |
||||
|
{ |
||||
|
private TextMeshProUGUI text; |
||||
|
private void Start() |
||||
|
{ |
||||
|
text = GetComponent<TextMeshProUGUI>(); // Because of the meta tag, Unity will make sure this exists. No sanity checks
|
||||
|
} |
||||
|
|
||||
|
public void SetName(string name) |
||||
|
{ |
||||
|
if(text == null) text = GetComponent<TextMeshProUGUI>(); // Just in case this gets called before Start()
|
||||
|
text.text = name; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
fileFormatVersion: 2 |
||||
|
guid: f1bf98089f9db1b4aacb219d05609744 |
||||
|
MonoImporter: |
||||
|
externalObjects: {} |
||||
|
serializedVersion: 2 |
||||
|
defaultReferences: [] |
||||
|
executionOrder: 0 |
||||
|
icon: {instanceID: 0} |
||||
|
userData: |
||||
|
assetBundleName: |
||||
|
assetBundleVariant: |
||||
|
Before Width: | Height: | Size: 411 B After Width: | Height: | Size: 128 B |
|
Before Width: | Height: | Size: 413 B After Width: | Height: | Size: 128 B |
Binary file not shown.
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 130 B |
Loading…
Reference in new issue