-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnityObjectManager.cs
More file actions
22 lines (20 loc) · 927 Bytes
/
Copy pathUnityObjectManager.cs
File metadata and controls
22 lines (20 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
namespace UnityIceFebruary
{
using IceFebruary;
using IceFebruary.Space;
using UnityIceFebruary.Adaptation;
/// <summary>
/// Unity realization of an interface that acts as a manager for creating game objects.
/// </summary>
public sealed class UnityObjectManager : BaseEntity, IObjectManager
{
/// <summary>
/// Creates a new Unity realization of an interface that acts as a manager for creating game objects.
/// </summary>
public UnityObjectManager() { }
/// <summary>
/// Create a game object on scene.
/// </summary>
public IGameObject Create(IGameObject gameObject, Vector2 position, Rotor2 rotation) => gameObject is UnityGameObject unityGameObject ? UnityMethods.Upsert<UnityEngine.GameObject, IGameObject>(UnityEngine.Object.Instantiate(unityGameObject.Original, position.ToUnity(), rotation.ToUnity())) : null;
}
}