예제 #1
0
    void Start()
    {
        EventManager.resetObjects += Reset;

        if (!Projectile.GetComponent <SpriteRenderer> ())
        {
            Projectile.AddComponent <SpriteRenderer> ();
        }

        SuperScript = gameObject.AddComponent <NewObjectSpawner> ();
        Target      = new Vector3(Xdirection, Ydirection);

        SuperScript.EnablePooling = EnablePooling;
        SuperScript.SetProjectile(0, Projectile);
        SuperScript.SetDeathTimer(0, DeathTimer);
        SuperScript.SetKinematicObjects(0, IsKinematic);

        if (RandomColor)
        {
            SuperScript.SetColor_Random(0);
        }

        TimeToSpawnObjects = ObjectAmount * ObjectDelay;

        if (IsEnabled)
        {
            StartCoroutine("C_StartCoroutine");
        }
    }