-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BlackboardValueView.cs
30 lines (27 loc) · 1.08 KB
/
BlackboardValueView.cs
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
// Copyright (c) 2019-2020 Vladimir Popov zor1994@gmail.com https://github.com/ZorPastaman/Event-Based-Blackboard
using System;
namespace Zor.EventBasedBlackboard.BlackboardValueViews
{
/// <summary>
/// <para>View for a blackboard value.</para>
/// <para>Inherit this to make a drawer for a value of
/// <see cref="Zor.EventBasedBlackboard.Core.Blackboard"/>.</para>
/// </summary>
/// <typeparam name="T">Value type.</typeparam>
/// <remarks>
/// Blackboard values are drawn by this class because Unity draws properties by itself only if the property is
/// serialized by Unity which is not true for the Blackboard system.
/// </remarks>
public abstract class BlackboardValueView<T> : IBlackboardValueView
{
/// <inheritdoc/>
public Type valueType => typeof(T);
/// <summary>
/// Draws <paramref name="value"/> in the editor and returns new value.
/// </summary>
/// <param name="label">Label which is used in the editor.</param>
/// <param name="value">Current value.</param>
/// <returns>New value.</returns>
public abstract T DrawValue(string label, T value);
}
}