Exemple #1
0
    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);
    }
Exemple #2
0
    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;
    }
Exemple #3
0
 public virtual void Initialize(FallingObjectData objectSettings)
 {
     // Set objecttype
     Debug.Log("I am a " + objectSettings.getMass());
 }