Inheritance: MonoBehaviour
コード例 #1
0
ファイル: ObjectProperties.cs プロジェクト: ajmed/blink
    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();
    }
コード例 #2
0
ファイル: ObjectProperties.cs プロジェクト: zehro/Projects
 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();
 }
コード例 #3
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }
コード例 #4
0
ファイル: AnimationHub.cs プロジェクト: zehro/Projects
 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>();
 }
コード例 #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();
        }
    }
コード例 #6
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 ();
        }
    }
コード例 #7
0
ファイル: ObjectProperties.cs プロジェクト: ajmed/blink
 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();
 }
コード例 #8
0
 private void Awake()
 {
     LEDlightmapSwitcher      = FindObjectOfType <LEDstripLightmapSwitcher>();
     timeOfDayManager         = FindObjectOfType <TimeOfDayManager>();
     dayNightLightmapSwitcher = FindObjectOfType <DayNightLightmapSwitcher>();
 }
コード例 #9
0
ファイル: ObjectProperties.cs プロジェクト: zehro/Projects
    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();
    }
コード例 #10
0
 public DisplayText(TimeOfDayManager timeOfDayManager)
 {
     this.timeOfDayManager = timeOfDayManager;
 }
コード例 #11
0
 public TransitionToDay(TimeOfDayManager timeOfDayManager)
 {
     this.timeOfDayManager = timeOfDayManager;
 }