Added player character and step in/out of dialogue in scene 101
This commit is contained in:
+86
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace UnityEngine.ProBuilder.KdTree
|
||||
{
|
||||
[Serializable]
|
||||
[DataContract]
|
||||
class KdTreeNode<TKey, TValue>
|
||||
{
|
||||
public KdTreeNode()
|
||||
{
|
||||
}
|
||||
|
||||
public KdTreeNode(TKey[] point, TValue value)
|
||||
{
|
||||
Point = point;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
[DataMember]
|
||||
public TKey[] Point;
|
||||
[DataMember]
|
||||
public TValue Value = default(TValue);
|
||||
[DataMember]
|
||||
public List<TValue> Duplicates = null;
|
||||
|
||||
[DataMember]
|
||||
internal KdTreeNode<TKey, TValue> LeftChild = null;
|
||||
[DataMember]
|
||||
internal KdTreeNode<TKey, TValue> RightChild = null;
|
||||
|
||||
internal KdTreeNode<TKey, TValue> this[int compare]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (compare <= 0)
|
||||
return LeftChild;
|
||||
else
|
||||
return RightChild;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (compare <= 0)
|
||||
LeftChild = value;
|
||||
else
|
||||
RightChild = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsLeaf
|
||||
{
|
||||
get
|
||||
{
|
||||
return (LeftChild == null) && (RightChild == null);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddDuplicate(TValue value)
|
||||
{
|
||||
if (Duplicates == null)
|
||||
Duplicates = new List<TValue>() { value };
|
||||
else
|
||||
Duplicates.Add(value);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
for (var dimension = 0; dimension < Point.Length; dimension++)
|
||||
{
|
||||
sb.Append(Point[dimension].ToString());
|
||||
}
|
||||
|
||||
if (Value == null)
|
||||
sb.Append("null");
|
||||
else
|
||||
sb.Append(Value.ToString());
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user