void Start() { SessionParameters parameters = FindObjectOfType <SessionParameters>(); if (parameters != null) { dirtiness = parameters.GetChoice(dirtinessParameterName, defaultValue).Index; } else { dirtiness = defaultValue; } for (int i = 0; i < dirtyObjects.Count; i++) { if (dirtyObjects[i] != null) { dirtyObjects[i].SetActive(i <= dirtiness); } } var em = Dust.emission; var rate = new ParticleSystem.MinMaxCurve(); rate.constantMax = particleRate[dirtiness < particleRate.Length ? dirtiness : particleRate.Length - 1]; em.rate = rate; }
// Use this for initialization void Start() { SessionParameters parameters = FindObjectOfType <SessionParameters>(); var lengthIndex = defaultValue; if (parameters != null) { lengthIndex = parameters.GetChoice(parameterName, defaultValue).Index; } if (lengths.Count > lengthIndex) { GetComponent <Grabber>().MaxLength = lengths[lengthIndex]; } }
void Start() { SessionParameters parameters = FindObjectOfType <SessionParameters>(); var speedIndex = defaultValue; if (parameters != null) { reaction = (ReactionType)parameters.GetChoice(reactionParameterName, (int)defaultValue).Index; } else { reaction = defaultValue; } UpdateAll(); }
void Start() { SessionParameters parameters = FindObjectOfType <SessionParameters>(); var sizeIndex = defaultValue; if (parameters != null) { sizeIndex = parameters.GetChoice(sizeParameterName, defaultValue).Index; } if (sizes.Count > sizeIndex) { size = sizes[sizeIndex]; UpdateAll(); } }