1
This commit is contained in:
28
Assets/Artists/Scripts/Placement/UnityPlacementService.cs
Normal file
28
Assets/Artists/Scripts/Placement/UnityPlacementService.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BITFALL.Placement
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class UnityPlacementServiceSingleton:PlacementServiceImplementation
|
||||
{
|
||||
protected override IPlacementService _placementServiceImplementation => UnityPlacementService.Singleton;
|
||||
}
|
||||
public class UnityPlacementService : MonoBehaviour,IPlacementService
|
||||
{
|
||||
public static IPlacementService Singleton { get; private set; }
|
||||
|
||||
[SerializeField] private UnityPlacementObject[] placementObjects;
|
||||
public IPlacementObject CurrentPlacementObject { get; private set; }
|
||||
public bool TryGetCurrentObject(out IPlacementObject placementObject)
|
||||
{
|
||||
placementObject = CurrentPlacementObject;
|
||||
return placementObject != null;
|
||||
}
|
||||
public IPlacementObject[] PlacementObjects => placementObjects.Cast<IPlacementObject>().ToArray();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user