// Use this for initialization void Start() { spotLight = new SpotLightParam(); spotLight.position = transform.position; spotLight.color = Color.white; spotLight.range = 3f; spotLight.direction = transform.eulerAngles.z * Mathf.PI / 180f; spotLight.angle = 70f * Mathf.PI / 180f; spotLight.centerAngle = 30f * Mathf.PI / 180f; LightManager lm = Camera.main.GetComponent <LightManager>(); lm.AddSpotLight(spotLight); }