-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateDisplay.cs
More file actions
32 lines (29 loc) · 934 Bytes
/
CreateDisplay.cs
File metadata and controls
32 lines (29 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Kitchen;
using KitchenMods;
using System.Runtime.InteropServices;
using Unity.Entities;
using UnityEngine;
namespace KitchenInGameTimer
{
[StructLayout(LayoutKind.Sequential, Size = 1)]
public struct SDisplay : IComponentData, IModComponent { }
public class CreateDisplay : RestaurantSystem, IModSystem
{
protected override void OnUpdate()
{
if (Has<SDisplay>())
return;
Entity singleton = EntityManager.CreateEntity(typeof(SDisplay), typeof(CDoNotPersist), typeof(CPosition), typeof(CRequiresView));
Set(singleton, new CRequiresView()
{
Type = Main.TIMER_VIEW_TYPE,
ViewMode = ViewMode.Screen,
PhysicsDriven = false
});
Set(singleton, new CPosition()
{
Position = new Vector3(1f, 0.72f, 0f)
});
}
}
}