Here is preview. You can customize it to fit your project.
classSelectableRealWorldSample:MonoBehaviour,ISelectable{ [field:SerializeField] publicObjectData Data { get; privateset; } [field:SerializeField] publicForceable Forceable { get; privateset; } [field:SerializeField] publicUnityEvent<bool> OnSelectChanged { get; privateset; } =new(); [field:SerializeField] publicUnityEvent<bool> OnHoverChanged { get; privateset; } =new();publicbool IsLocalPlayer =>Forceable.forceId==Forceable.LocalPlayerId;publicSprite Icon =>Data.icon; // Primary selection priority // Returns 0 for local player objects, 1 for others // Used to prioritize selecting player's own units firstpublicint SelectionPriority1 {get {if (IsLocalPlayer) return0;return1; } } // Secondary selection priority // Prioritizes units (0) over structures (1) and other types (2)publicint SelectionPriority2 {get {if (Data.type==ObjectType.Unit) return0;elseif (Data.type==ObjectType.Structure) return1;return2; } } // Tertiary selection priority // For units, returns 0 // For other types, uses the Order valuepublicint SelectionPriority3 {get {if (Data.type==ObjectType.Unit) return0;return Order; } } // Determines the ordering within selection groups // Units get a higher base order (10000 + ID) // Other types just use their IDpublicint Order {get {int order =0;if (Data.type==ObjectType.Unit) { order +=10000; } order +=Data.id;return order; } } // SubGroupId uses the object's ID for grouping related selectablespublicint SubGroupId =>Data.id; // Only local player objects can be multi-selectedpublicbool CanBeMultiSelected => IsLocalPlayer; // Only local player objects can be groupedpublicbool CanBeGrouped => IsLocalPlayer;}