So, I’ve been trying to get all dates with DateTime using this script, but it throws a nullreference at line 17. Any idea why? I’ve only just now started looking at DateTime, so maybe I’m misunderstanding some stuff here.
Here’s the script( called Test.js ) :
#pragma strict
import System;
import System.Globalization;
var testArr: testClass[];
function Start()
{
testArr = new testClass[7];
for(var i:int=0;i<7;i++)
{
var tmpWeekStart: DateTime = DateTime.Now;
tmpWeekStart.AddDays(-Convert.ToInt32(DateTime.Now.DayOfWeek));
testArr*.testDate = tmpWeekStart.AddDays(i);*
_ print(testArr*.testDate);_
_ }_
_}*_
function Update () {
}
class testClass
{
* var testDate: DateTime;*
}