BITKit/Src/Unity/Scripts/MarkSystem/Core/IMarkSystem.cs

29 lines
698 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit.MarkSystem
{
public interface IMarkObject
{
public int Id { get; }
public Vector3 Position { get; }
public object Object { get; }
}
public interface IMarkSystem
{
public void Register(IMarkObject markObject);
public void UnRegister(IMarkObject markObject);
}
public class MarkObject : IMarkObject
{
public override bool Equals(object obj) => obj is MarkObject x && x.Id == Id;
public override int GetHashCode() => Id.GetHashCode();
private static int count;
public int Id { get; } = count++;
public Vector3 Position { get; set; }
public object Object { get; set; }
}
}