What is wrong with my C# script?

I am trying to make a fire, where the light starts to appear as my fire does. I tried to write a code for it, but it simply changed the intensity right when I press play instead of as the fire builds like I want it to.

using UnityEngine;
using System.Collections;

public class LightScriptoid : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update() {
		if(gameObject.particleSystem.startDelay == 2.0f){
			
	    }
			gameObject.renderer.light.intensity = 1.0f;
		}
	}

if(gameObject.particleSystem.startDelay == 2.0f)
{
gameObject.renderer.light.intensity = 1.0f;
}

I assume this is what you were meaning to do?

In your original code your changing your light intensity outside of the IF statement.

I recently went through the project tutorials, and I think what you want might be thereā€¦

something like this?
a lower fadespeed value will cause the light to fade in slower, and high will increase it.

using UnityEngine;
using System.Collections;

public class LightScriptoid : MonoBehaviour {


	// Use this for initialization
	void Awake ()
	{
		// When the level starts we want the light to be "off".
		light.intensity = 0f;
	}

	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		if (gameObject.particleSystem.startDelay == 2){
			float fadeSpeed = 0.5f;
			gameObject.light.intensity = Mathf.Lerp(light.intensity, 1f, fadeSpeed * Time.deltaTime);
		}
	}
}