SceneGraph.cs 685 B

1234567891011121314151617181920212223
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using XNode;
  5. namespace XNode {
  6. /// <summary> Lets you instantiate a node graph in the scene. This allows you to reference in-scene objects. </summary>
  7. public class SceneGraph : MonoBehaviour {
  8. public NodeGraph graph;
  9. }
  10. /// <summary> Derive from this class to create a SceneGraph with a specific graph type. </summary>
  11. /// <example>
  12. /// <code>
  13. /// public class MySceneGraph : SceneGraph<MyGraph> {
  14. ///
  15. /// }
  16. /// </code>
  17. /// </example>
  18. public class SceneGraph<T> : SceneGraph where T : NodeGraph {
  19. public new T graph { get { return base.graph as T; } set { base.graph = value; } }
  20. }
  21. }