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.
27 lines
838 B
27 lines
838 B
using System;
|
|
using TNodeCore.Runtime.Attributes;
|
|
using UnityEngine;
|
|
using UnityEngine.Serialization;
|
|
|
|
namespace TNodeCore.Runtime.Models{
|
|
[Serializable]
|
|
public abstract class Model:ICloneable{
|
|
#if UNITY_EDITOR
|
|
[HideInBlackboard]
|
|
public Rect positionInView;
|
|
#endif
|
|
[DisableOnInspector]
|
|
[HideInBlackboard]
|
|
public string id;
|
|
[NonSerialized]
|
|
private int _fastAccessId=0;
|
|
public object Clone(){
|
|
var memberwiseClone = this.MemberwiseClone();
|
|
return memberwiseClone;
|
|
}
|
|
/// <summary>
|
|
/// Record and map the node by a string is cost.converted it to an integer to speed the process.
|
|
/// </summary>
|
|
public int FastAccessId => _fastAccessId==0?_fastAccessId=GetHashCode():_fastAccessId;
|
|
}
|
|
} |