private void SpawnDrop() { FallingObjectData data = possibleDrops[Random.Range(0, possibleDrops.Count)]; Drop newDrop = Instantiate(dropPrefab); float xPosition = Random.Range(spawnMostLeft, spawnMostRight); newDrop.transform.position = new Vector3(xPosition, spawnHeight, 0f); newDrop.Initialize(data); }
public void Initialize(FallingObjectData settings) { effectOnPlantStage = settings.effectOnPlantStage; initialScale = settings.initialScale; fullScale = settings.fullScale; growTime = settings.growTime; spriteRenderer.sprite = settings.sprite; growPerSecond = (fullScale - initialScale) / growTime; transform.localScale = new Vector3(initialScale, initialScale, initialScale); isGrowing = true; }
public virtual void Initialize(FallingObjectData objectSettings) { // Set objecttype Debug.Log("I am a " + objectSettings.getMass()); }