void OnEnable() { primitive = (CloudGenerator)target; fill = serializedObject.FindProperty("fill"); offset = serializedObject.FindProperty("addPos"); space = serializedObject.FindProperty("space"); verts = serializedObject.FindProperty("vertexCount"); children = serializedObject.FindProperty("MeshInChildren"); }
public void Init(CloudGenerator cloudGenerator, Vector3 direction, float depth, float speed, float despawnXPosition) { this.cloudGenerator = cloudGenerator; this.direction = direction; this.depth = depth; this.speed = speed; this.despawnXPosition = despawnXPosition; isInitialised = true; }
private void Awake() { platformGenerator = new PlatformGenerator(platforms); platformGenerator.CreatePlatforms(); starGenerator = new StarGenerator(stars, player.gameObject); starGenerator.CreateStars(starDensity); cloudGenerator = new CloudGenerator(clouds, player.gameObject); cloudGenerator.CreateClouds(cloudDensity); killZone = GameObject.FindWithTag("Kill Zone"); }
override protected void Start() { base.Start(); cg = transform.parent.GetComponent <CloudGenerator>(); if (cg == null) { Debug.LogError("Cloud Generator not found or isn't a parent of cloud " + GetInstanceID()); gameObject.SetActive(false); } LocalWindModifier = Vector3.zero; // Change to some little values, maybe modify slightly in update ? }
public void SetUp() { cloudOptions = DefaultCloudOptions; randomWords = Enumerable.Range(0, 50) .Select(wordNumber => TestsHelper.GetRandomString((wordNumber / 10 + 1) * 2, TestContext.CurrentContext.Random)) .ToArray(); excludedWords = randomWords.Where(word => word.Length <= 2); vocabularyParser = A.Fake <ICloudVocabularyParser>(); A.CallTo(() => vocabularyParser.GetCloudVocabulary(DefaultCloudOptions.CloudVocabularyFilename)) .Returns(randomWords.AsEnumerable().AsResult()); A.CallTo(() => vocabularyParser.GetCloudVocabulary( DefaultCloudOptions.ExcludedWordsVocabularyFilename)) .Returns(excludedWords.AsEnumerable().AsResult()); contextGenerator = new CloudContextGenerator(cloudOptions, vocabularyParser); cloudGenerator = new CloudGenerator(contextGenerator, PreprocessorConstructor); }
/// <summary> /// Start the clouds appearing /// </summary> public override void CreateClouds() { if (mesh.vertexCount == 0) { CloudGenerator cloudGenerator = new CloudGenerator(mesh, NumberOfClouds, MaterialRows, MaterialColumns); cloudGenerator.AngularVelocityRange = AngularVelocityRange; cloudGenerator.BoundsRadius = BoundsRadius; cloudGenerator.BoundsCenter = BoundsCenter; cloudGenerator.BoundsHeightRange = BoundsHeightRange; cloudGenerator.FadeTimeRange = FadeTimeRange; cloudGenerator.FadeTimeDelayRange = FadeTimeDelayRange; cloudGenerator.LifeTimeRange = LifeTimeRange; cloudGenerator.RadiusRange = RadiusRange; cloudGenerator.VelocityRangeX = VelocityRangeX; cloudGenerator.VelocityRangeZ = VelocityRangeZ; cloudGenerator.CreateClouds(); cloudGenerator.Apply(); } else { CloudGenerator.ShowClouds(mesh, LifeTimeRange, FadeTimeRange, FadeTimeDelayRange); } SetFlareEnabled(false); }
private void Awake() { Instance = this; }
/// <summary> /// Start the clouds disappearing /// </summary> public override void RemoveClouds() { CloudGenerator.HideClouds(mesh, FadeTimeRange, FadeTimeDelayRange); SetFlareEnabled(true); }
//Gets a new cloud at runtime using the component's settings void Start() { CloudGenerator gen = FindObjectOfType <CloudGenerator>(); GetComponent <MeshFilter>().sharedMesh = gen.RuntimeCloud(); }
void Start() { m_cloudGenerator = FindObjectOfType <CloudGenerator>(); m_emittersToFade = GetComponentsInChildren <ParticleSystem>(); m_camera = Camera.main.transform; }
void Start() { cloudGenerator = gameObject.GetComponentInParent <CloudGenerator>(); }