void Initialize() { if (config == null) { config = GetComponent <DungeonConfig> (); } if (sceneProvider == null) { sceneProvider = GetComponent <PooledDungeonSceneProvider> (); } if (dungeonBuilder == null) { dungeonBuilder = GetComponent <DungeonBuilder> (); } if (dungeonModel == null) { dungeonModel = GetComponent <DungeonModel> (); } }
/// <summary> /// Implementations should override this and determine if the node should be selected (inserted into the scene) /// </summary> /// <param name="socket">The marker data-structure</param> /// <param name="propTransform">The combined transform of the visual node that invoked this rule</param> /// <param name="model">The dungeon model</param> /// <param name="random">The random stream used by the builder. User this random stream for any randomness for consistancy</param> /// <returns></returns> public virtual bool CanSelect(PropSocket socket, Matrix4x4 propTransform, DungeonModel model, System.Random random) { return(true); }
/// <summary> /// Called after the dungeon is completely built /// </summary> /// <param name="model">The dungeon model</param> public virtual void OnPostDungeonBuild(Dungeon dungeon, DungeonModel model) { }
/// <summary> /// Called after all the markers have been emitted for the level (but before the theming engine is run on those markers) /// This gives you an opportunity to modify the markers /// </summary> /// <param name="dungeon"></param> /// <param name="model"></param> public virtual void OnDungeonMarkersEmitted(Dungeon dungeon, DungeonModel model, List <PropSocket> markers) { }
/// <summary> /// Implement this method to provide a transform based on your logic. /// </summary> /// <param name="socket">The marker data structure</param> /// <param name="model">The dungeon model</param> /// <param name="propTransform">The combined transform of the visual node that invoked this rule</param> /// <param name="random">The random stream used by the builder. User this random stream for any randomness for consistancy</param> /// <param name="outPosition">Set your position offset here</param> /// <param name="outRotation">Set your rotation offset here</param> /// <param name="outScale">Set your scale offset here</param> public virtual void GetTransform(PropSocket socket, DungeonModel model, Matrix4x4 propTransform, System.Random random, out Vector3 outPosition, out Quaternion outRotation, out Vector3 outScale) { outPosition = Vector3.zero; outRotation = Quaternion.identity; outScale = Vector3.one; }
/// <summary> /// Called after all the markers have been emitted for the level (but before the theming engine is run on those markers) /// This gives you an opportunity to modify the markers /// </summary> /// <param name="dungeon"></param> /// <param name="model"></param> public virtual void OnDungeonMarkersEmitted(Dungeon dungeon, DungeonModel model, LevelMarkerList markers) { }