123456789101112131415161718192021222324252627282930 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Sirenix.OdinInspector;
- using KairoEngine.Core;
- namespace KairoEngine.UI
- {
- public class FloatingValuesController : MonoBehaviour
- {
- public GameObject floatingValueUiPrefab;
- public Transform canvasParent;
- void OnEnable()
- {
- FloatingMessageEvents.OnMessage += OnMessage;
- }
- void OnDisable()
- {
- FloatingMessageEvents.OnMessage -= OnMessage;
- }
- private void OnMessage(string message, Vector3 targetPos, float offset, float time, float fontSize)
- {
- GameObject obj = Instantiate(floatingValueUiPrefab, canvasParent);
- obj.GetComponent<FloatingValueUi>().Setup(targetPos, message, offset, time, fontSize);
- }
- }
- }
|