forked from Unity-Technologies/EntityComponentSystemSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetPlayerToDebugColorAuthoring.cs
More file actions
26 lines (24 loc) · 935 Bytes
/
Copy pathSetPlayerToDebugColorAuthoring.cs
File metadata and controls
26 lines (24 loc) · 935 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
using System;
using Unity.Entities;
using Unity.Rendering;
namespace Unity.NetCode.Samples.Common
{
/// <summary>Denotes that a ghost will be set to the debug color specified in <see cref="NetworkIdDebugColorUtility"/>.</summary>
public struct SetPlayerToDebugColor : IComponentData
{
}
[UnityEngine.DisallowMultipleComponent]
public class SetPlayerToDebugColorAuthoring : UnityEngine.MonoBehaviour
{
class SetPlayerToDebugColorBaker : Baker<SetPlayerToDebugColorAuthoring>
{
public override void Bake(SetPlayerToDebugColorAuthoring authoring)
{
SetPlayerToDebugColor component = default(SetPlayerToDebugColor);
var entity = GetEntity(TransformUsageFlags.Dynamic);
AddComponent(entity, component);
AddComponent(entity, new URPMaterialPropertyBaseColor {Value = 1});
}
}
}
}