ICreateNodeFromObject.cs 903 B

1234567891011121314151617181920
  1. using UnityEngine;
  2. using System;
  3. using Object = UnityEngine.Object;
  4. namespace GraphProcessor
  5. {
  6. /// <summary>
  7. /// Implement this interface on a BaseNode, it allows you to automatically spawn a node if an asset of type T is dropped in the graphview area
  8. /// </summary>
  9. /// <typeparam name="T">The type object your node will be created from, it must be a subclass of UnityEngine.Object</typeparam>
  10. public interface ICreateNodeFrom<T> where T : Object
  11. {
  12. /// <summary>
  13. /// This function is called just after creating the node from an object and allows you to initialize the node with the object data.
  14. /// </summary>
  15. /// <param name="value">Object value</param>
  16. /// <returns>True if the initialization happened correctly. False otherwise, returning false will discard your node.</returns>
  17. bool InitializeNodeFromObject(T value);
  18. }
  19. }