How do I make this o it accepts gameobjects like cubes or other objects right now its only accepting lights and I cant seem to find why?
Here is the code:
{
public List<GameObject> gameobjects = new List<GameObject>();
public string theTime = System.DateTime.Now.ToString("hh:mm:ss");
public string theDate = System.DateTime.Now.ToString("MM/dd/yyyy");
public string StartDate = "mm/dd/yyy";
public string StartTime = "hh:mm:ss";
public string EndDate = "mm/dd/yyy";
public string EndTime = "hh:mm:ss";
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
theTime = System.DateTime.Now.ToString("hh:mm:ss");
theDate = System.DateTime.Now.ToString("MM/dd/yyyy");
if(theDate == (StartDate) && theTime == (StartTime))
{
foreach(GameObject gameobject in gameobjects)
{
gameobject.SetActiveRecursively(false);
}
}
if(theDate == (EndDate) && theTime == (EndTime))
{
foreach(GameObject gameobject in gameobjects)
{
gameobject.SetActiveRecursively(true);
}
}
}