Inheritance: MonoBehaviour
Exemple #1
0
    public void OnEnable()
    {
        if (debugLogness)
        {
            Debug.Log("Enable Properties", this);
        }
        if (timeOfDayManager == null)
        {
            Debug.LogWarning("no timeOfDayManager found, so finding one now ( you should make sure TimeOfDayManager runs first and finds all objects it wants to control", this); // If a TimeOfDayManager fails to claim this as something for it to control, the item itself can find a TimeOfDayManager and tell it to control it, this is expensive at the moment as each time this happens it requests the TimeOfDayManager seek all scene objects, so is used in emergency only hence the above warning
            timeOfDayManager = FindObjectOfType <TimeOfDayManager>();                                                                                                             // may have multiple managers in future so bad
        }


        if (timeOfDayManager != null)
        {
            timeOfDayManager.AmIadded(this);                                   // For editor use
        }
        if (mirrorLight)
        {
            mirror();
        }
        Setup();
        hasSetup = true;
        Run();
    }
Exemple #2
0
 public void ApplyProperties(float timeIn, TimeOfDayManager timeOfDayManagerIn)
 {
     timeOfDayManager = timeOfDayManagerIn;
     //timeOfDayManagero = timeOfDayManagerIn.gameObject;
     time = timeIn;
     if (!awakeRan) return;
     if (!enabled) return; // Only Runs if object is enabled, but if disabled will update the time variable ready for when it is enabled
     if (!hasSetup) OnEnable();
     Run();
 }
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Exemple #4
0
 public void Awake()
 {
     if (Application.isPlaying) previewMode = false;
     #if UNITY_EDITOR
     if (!Application.isPlaying) {
         EditorApplication.update -= Update;
         EditorApplication.update += Update;
     }
     #endif
     if (timeOfDayManager == null) timeOfDayManager = FindObjectOfType<TimeOfDayManager>();
     if (colorGradingProperties == null) colorGradingProperties = FindObjectOfType<ColorGradingProperties>();
 }
Exemple #5
0
    void OnEnable()
    {
        sunProperties      = GetComponent <SunProperties> ();
        m_TimeOfDayManager = FindObjectOfType <TimeOfDayManager> ();
        m_PrevAmbientMode  = RenderSettings.ambientMode;

        RenderSettings.ambientMode = UnityEngine.Rendering.AmbientMode.Trilight;
        if (sunProperties != null)
        {
            sunProperties.ambientMultiply = ambientMultiply;
            sunProperties.Run();
        }
    }
    void OnEnable()
    {
        sunProperties = GetComponent<SunProperties> ();
        m_TimeOfDayManager = FindObjectOfType<TimeOfDayManager> ();
        m_PrevAmbientMode = RenderSettings.ambientMode;

        RenderSettings.ambientMode = UnityEngine.Rendering.AmbientMode.Trilight;
        if (sunProperties != null)
        {
            sunProperties.ambientMultiply = ambientMultiply;
            sunProperties.Run ();
        }
    }
Exemple #7
0
 public void ApplyProperties(float timeIn, TimeOfDayManager timeOfDayManagerIn)
 {
     timeOfDayManager = timeOfDayManagerIn;
     //timeOfDayManagero = timeOfDayManagerIn.gameObject;
     time = timeIn;
     if (!awakeRan)
     {
         return;
     }
     if (!enabled)
     {
         return;                   // Only Runs if object is enabled, but if disabled will update the time variable ready for when it is enabled
     }
     if (!hasSetup)
     {
         OnEnable();
     }
     Run();
 }
Exemple #8
0
 private void Awake()
 {
     LEDlightmapSwitcher      = FindObjectOfType <LEDstripLightmapSwitcher>();
     timeOfDayManager         = FindObjectOfType <TimeOfDayManager>();
     dayNightLightmapSwitcher = FindObjectOfType <DayNightLightmapSwitcher>();
 }
Exemple #9
0
    public void OnEnable()
    {
        if (debugLogness) Debug.Log("Enable Properties", this);
        if (timeOfDayManager == null) {
            Debug.LogWarning("no timeOfDayManager found, so finding one now ( you should make sure TimeOfDayManager runs first and finds all objects it wants to control", this); // If a TimeOfDayManager fails to claim this as something for it to control, the item itself can find a TimeOfDayManager and tell it to control it, this is expensive at the moment as each time this happens it requests the TimeOfDayManager seek all scene objects, so is used in emergency only hence the above warning
            timeOfDayManager = FindObjectOfType<TimeOfDayManager>(); // may have multiple managers in future so bad
        }

        if (timeOfDayManager != null) timeOfDayManager.AmIadded(this); // For editor use
        if (mirrorLight) mirror();
        Setup();
        hasSetup = true;
        Run();
    }
Exemple #10
0
 public DisplayText(TimeOfDayManager timeOfDayManager)
 {
     this.timeOfDayManager = timeOfDayManager;
 }
Exemple #11
0
 public TransitionToDay(TimeOfDayManager timeOfDayManager)
 {
     this.timeOfDayManager = timeOfDayManager;
 }