//---------------------// // Init / Dispose // //---------------------// //---------------------// // handler // //---------------------// public void OnEnable() { editedScript = (InstantGoodDay) target; RenderCamera = serializedObject.FindProperty("RenderCameraEditorProperty"); TimeOfDay = serializedObject.FindProperty("TimeOfDayEditorProperty"); IsTimePassEnable = serializedObject.FindProperty("IsTimePassEnableEditorProperty"); DayDurationInSeconds = serializedObject.FindProperty("DayDurationInSecondsEditorProperty"); DailyAnimList = serializedObject.FindProperty("AdditionalDailyAnimations"); }
// script code examples here. // // this script is responsable for displaying the ui, but in particular we will // manipulate the InstantGoodDay component in order to get the current time of the day // to show it on the bottom-left corner of the screen. void Awake() { // first, get a reference to the InstantGoodDay prefab in the scene, like this: _instantGoodDay = GameObject.FindObjectOfType<InstantGoodDay>(); }