WorldObject.cs 902 B

1234567891011121314151617181920212223242526272829
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Sirenix.OdinInspector;
  5. using KairoEngine.Inventory;
  6. namespace KairoEngine.CharacterSystem
  7. {
  8. public enum WorldObjectType
  9. {
  10. Character,
  11. Item,
  12. ItemContainer
  13. }
  14. public class WorldObject : MonoBehaviour
  15. {
  16. public WorldObjectType objectType;
  17. [ShowIf("@objectType == WorldObjectType.Character")] public CharacterController character;
  18. [ShowIf("@objectType == WorldObjectType.Item")] public WorldItem item;
  19. [ShowIf("@objectType == WorldObjectType.ItemContainer")] public WorldItemContainer itemContainer;
  20. public bool IsCharacter() => objectType == WorldObjectType.Character;
  21. public bool IsItem() => objectType == WorldObjectType.Item;
  22. public bool IsItemContainer() => objectType == WorldObjectType.ItemContainer;
  23. }
  24. }