BITFALL/Assets/Artists/Scripts/LootSystem/UnityInfoLootSpawn.cs

36 lines
827 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using BITFALL.GameMode;
using BITKit;
using Unity.Mathematics;
using UnityEngine;
namespace BITFALL.LootSystem
{
public class UnityInfoLootSpawn : MonoBehaviour,InfoLootSpawn
{
[SerializeField] private Vector3 size;
public string[] Tags { get; set; }
public float3 Position { get; set; }
public float3 Size { get; set; }
private void OnEnable()
{
Tags = TryGetComponent<ITag>(out var _tag) ? _tag.GetTags() : Array.Empty<string>();
Position = transform.position;
Size = size;
NodeQuery.Register<InfoLootSpawn>(this);
}
private void OnDisable()
{
NodeQuery.Unregister<InfoLootSpawn>(this);
}
private void OnDrawGizmos()
{
Gizmos.color = Color.green;
Gizmos.DrawWireCube(transform.position,Size);
}
}
}