Revision 125:2f0ae0194ff2

b/Assets/Tidmarsh.unity
102 102
  - 114: {fileID: 418875222}
103 103
  - 114: {fileID: 418875223}
104 104
  - 114: {fileID: 418875224}
105
  - 114: {fileID: 418875225}
105 106
  m_Layer: 0
106 107
  m_Name: ScriptSlab
107 108
  m_TagString: GameController
......
301 302
  m_Script: {fileID: 11500000, guid: d306ea13a01f4462ca677c9f6f7de269, type: 3}
302 303
  m_Name: 
303 304
  m_EditorClassIdentifier: 
305
--- !u!114 &418875225
306
MonoBehaviour:
307
  m_ObjectHideFlags: 0
308
  m_PrefabParentObject: {fileID: 0}
309
  m_PrefabInternal: {fileID: 0}
310
  m_GameObject: {fileID: 418875214}
311
  m_Enabled: 1
312
  m_EditorHideFlags: 0
313
  m_Script: {fileID: 11500000, guid: 63f621286f1a645be801c1611fcbc872, type: 3}
314
  m_Name: 
315
  m_EditorClassIdentifier: 
304 316
--- !u!1 &866765608
305 317
GameObject:
306 318
  m_ObjectHideFlags: 0
b/Assets/Time of Day/Assets/Scripts/TOD_Time.cs
216 216
			sky.Cycle.Day   = DateTime.Now.Day;
217 217
		}
218 218

  
219
		// ------> added to TOD plugin
219 220
		if (UseBostonTime)
220 221
		{
221
			sky.Cycle.Hour = (float)DateTime.Now.TimeOfDay.TotalHours;
222
			int month = (int)DateTime.Now.Month;
223
			if(month>=3 && month <=11){
224
				sky.Cycle.Hour = (float)DateTime.UtcNow.TimeOfDay.TotalHours - 4;
225
				Debug.Log ("The time in Boston is now " + sky.Cycle.Hour + " hours (daylight savings).");
226
			}
227
			else{
228
				sky.Cycle.Hour = (float)DateTime.UtcNow.TimeOfDay.TotalHours - 5;
229
				Debug.Log ("The time in Boston is now " + sky.Cycle.Hour + " hours.");
230
			}
222
			sky.Cycle.Hour = bostonTime();
231 223
		}
232

  
224
		// <------ added to TOD plugin
233 225

  
234 226
		if (UseDeviceTime)
235 227
		{
......
240 232
		RefreshTimeCurve();
241 233
	}
242 234

  
235
	// ------> added to TOD plugin
236
	public float bostonTime()
237
	{
238
		float bostonTime;// = 12f;
239
		int month = (int)DateTime.Now.Month;
240
		if(month>=3 && month <=11){
241
			bostonTime = (float)DateTime.UtcNow.TimeOfDay.TotalHours - 4f;
242
			Debug.Log ("The time in Boston is now " + bostonTime + " hours (daylight savings).");
243
		}
244
		else{
245
			bostonTime = (float)DateTime.UtcNow.TimeOfDay.TotalHours - 5f;
246
			Debug.Log ("The time in Boston is now " + bostonTime + " hours.");
247
		}
248
		return bostonTime;
249
	}
250
	
251
	public float getTime()
252
	{
253
		return sky.Cycle.Hour;
254
	}
255
	// <------ added to TOD plugin
256

  
257

  
243 258
	protected void FixedUpdate()
244 259
	{
245 260
		if (ProgressTime && DayLengthInMinutes > 0)

Also available in: Unified diff