Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (null != myRepeater && null != myObject && myLastCycle < myWaves)
        {
            for (; myLastCycle <= myRepeater.Cycle(); myLastCycle++)
            {
                for (float i = 0f; i < myRadius * 5f; i++)
                {
                    ProjectileScript projectileScript = GlobalScript.New(
                        "Prefabs/Projectiles/Icicle",
                        transform.position + Vector3.up * myHeight + new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)).normalized *myRadius,
                        Quaternion.identity
                        ).GetComponent <ProjectileScript>();

                    projectileScript.myDeleteOnUnit = true;

                    projectileScript.myMessage = myMessage;

                    projectileScript.myClocker = new Clocker(3f);
                }
            }
        }
        else
        {
            Destroy(gameObject);
        }
    }