You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.4 KiB
48 lines
1.4 KiB
using System;
|
|
using TNodeCore.Runtime.Attributes;
|
|
using TNodeCore.Runtime.Attributes.Ports;
|
|
using TNodeCore.Runtime.RuntimeCache;
|
|
using UnityEngine;
|
|
|
|
namespace TNodeCore.Runtime.Models{
|
|
[Serializable]
|
|
[InternalUsage]
|
|
public class BlackboardDragNode:SceneNode{
|
|
public string BlackDragData{
|
|
get => blackDragData;
|
|
set{
|
|
blackDragData = value;
|
|
if (blackDragData.Contains(".")){
|
|
isListElement = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public string blackDragData;
|
|
/// <summary>
|
|
/// it's very hacky way to get blackboard data ,even when the value is null,type info is not null!
|
|
/// </summary>
|
|
/// TODO : The type handling in a safer way in the future
|
|
[Output("",PortNameHandling.MemberType,TypeHandling.Implemented)]
|
|
public object Value{
|
|
get{
|
|
if (!isListElement){
|
|
return BlackboardData.GetValue(BlackDragData);
|
|
}
|
|
else{
|
|
var split = BlackDragData.Split('.');
|
|
var index = int.Parse(split[1]);
|
|
|
|
return BlackboardData.GetListValue(split[0],index);
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
public bool isListElement=false;
|
|
public BlackboardDragNode(){
|
|
|
|
}
|
|
|
|
}
|
|
} |