Beispiel #1
0
    void ResetLava()
    {
        GameObject lavaObj    = GameObject.FindGameObjectWithTag("Lava");
        Lava       lavaScript = (Lava)lavaObj.GetComponent(typeof(Lava));

        lavaScript.ResetPosition();
    }
    // Update is called once per frame
    void Update()
    {
        if (bill == null)
        {
            return;
        }
        if (!isBossSpawner && bill.transform.position.y >= this.transform.position.y || (
                isBossSpawner && bill.transform.position.y + 1f >= this.transform.position.y))
        {
            Bill b = bill.GetComponent <Bill>();
            if (b.spawner.transform.position.y < this.transform.position.y)
            {
                b.spawner           = this.gameObject;
                lava.lavaSpeed      = lavaSpeed;
                lava.startingYDelta = startingYDelta;

                if (setPosition)
                {
                    lava.ResetPosition();
                }
            }
        }
    }