Пример #1
0
 /// <summary>
 /// This method is called when the class has been added as a listener, and something has changed
 /// one of the WAPI settings.
 ///
 /// Use the HasChanged method to work out what was changed and respond accordingly.
 ///
 /// NOTE : As the majority of the World API values are properties, setting something
 /// is as easy as reading its value, and setting a property will cause another
 /// OnWorldChanged event to be raised.
 ///
 /// </summary>
 /// <param name="changeArgs"></param>
 public void OnWorldChanged(WorldChangeArgs changeArgs)
 {
     if (changeArgs.HasChanged(WorldConstants.WorldChangeEvents.GameTimeChanged))
     {
         if (m_gameTime != null)
         {
             m_gameTime.text = string.Format("Game Time : {0}", WorldManager.Instance.GetTimeDecimal());
         }
     }
     else if (changeArgs.HasChanged(WorldConstants.WorldChangeEvents.FogChanged))
     {
         if (m_fogHeightPower != null)
         {
             m_fogHeightPower.text = string.Format("Fog Height Power : {0}", WorldManager.Instance.FogHeightPower);
         }
         if (m_fogHeightMax != null)
         {
             m_fogHeightMax.text = string.Format("Fog Height Max : {0}", WorldManager.Instance.FogHeightMax);
         }
         if (m_fogDistancePower != null)
         {
             m_fogDistancePower.text = string.Format("Fog Distance Power : {0}", WorldManager.Instance.FogDistancePower);
         }
         if (m_fogDistanceMax != null)
         {
             m_fogDistanceMax.text = string.Format("Fog Distance Max : {0}", WorldManager.Instance.FogDistanceMax);
         }
     }
 }
Пример #2
0
 public void OnWorldChanged(WorldChangeArgs changeArgs)
 {
     if (changeArgs.HasChanged(WorldConstants.WorldChangeEvents.GameTimeChanged))
     {
         m_timeNow = (float)changeArgs.manager.GetTimeDecimal();
     }
 }