Beispiel #1
0
 void ProgressTimeline()
 {
     if (!m_UseSystemDateTime)
     {
         m_Timeline += (m_Progress && Application.isPlaying) ? LSkyTime.TimelineDelta(CycleDuration, k_TimelineLength) : 0.0f;
     }
     else
     {
         m_Timeline = (float)SystemDateTime.TimeOfDay.TotalHours;
     }
 }
Beispiel #2
0
        public override void OnInspectorGUI()
        {
            serObj.Update();

            EditorGUILayout.Separator();
            AC_EditorGUIUtility.ShurikenHeader("Time And Date", TextTitleStyle, 30);

            GUI.color = Color.white;
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            {
                EditorGUILayout.PropertyField(m_TimeUpdateMethod, new GUIContent("Time Update Method"));
                EditorGUILayout.PropertyField(m_DateUpdateMethod, new GUIContent("Date Update Method"));
                EditorGUILayout.PropertyField(m_Progress, new GUIContent("Progress"));
            }
            EditorGUILayout.EndVertical();
            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            {
                EditorGUILayout.PropertyField(m_UseSystemDateTime, new GUIContent("Use System Date Time"));
            }
            EditorGUILayout.EndVertical();
            //EditorGUILayout.Separator();

            if (!m_UseSystemDateTime.boolValue)
            {
                float min = m_DayRange.vector2Value.x;
                float max = m_DayRange.vector2Value.y;
                EditorGUILayout.BeginVertical();
                {
                    GUILayout.Label("Day Range");
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.MinMaxSlider(ref min, ref max, 0, 24);
                        m_DayRange.vector2Value = new Vector2(min, max);
                        EditorGUILayout.PropertyField(m_DayRange, new GUIContent(""));
                    }
                    EditorGUILayout.EndHorizontal();

                    string startInfo = "Day Start: " + LSkyTime.TimeToString
                                       (
                        LSkyTime.GetTimelineHour(min),
                        LSkyTime.GetTimelineMinute(min)
                                       );

                    string endInfo = "Day End: " + LSkyTime.TimeToString
                                     (
                        LSkyTime.GetTimelineHour(max),
                        LSkyTime.GetTimelineMinute(max)
                                     );
                    EditorGUILayout.HelpBox(startInfo + " | " + endInfo, MessageType.Info);

                    EditorGUILayout.Separator();

                    EditorGUILayout.PropertyField(m_DayLength, new GUIContent("Day In Minutes"));
                    EditorGUILayout.PropertyField(m_NightLength, new GUIContent("Night In Minutes"));
                }
                EditorGUILayout.EndVertical();
                EditorGUILayout.Separator();
            }

            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            {
                EditorGUILayout.PropertyField(m_Timeline, new GUIContent("Timeline"));
                EditorGUILayout.PropertyField(m_Day, new GUIContent("Day"));
                EditorGUILayout.PropertyField(m_Month, new GUIContent("Month"));
                EditorGUILayout.PropertyField(m_Year, new GUIContent("Year"));
            }
            EditorGUILayout.EndVertical();
            EditorGUILayout.HelpBox("Hour: " + tar.TimeDate.ToString("hh:mm:ss"), MessageType.Info);

            serObj.ApplyModifiedProperties();
        }