예제 #1
0
    void Update()
    {
        if (path != null)
        {
            if (targets.Count == 0)
            {
                return;
            }

            if (transform.position == targets[current])
            {
                current = CS_Utils.Mod(current + 1, targets.Count);
            }

            transform.position = Vector3.MoveTowards(transform.position, targets[current], Time.deltaTime * speed);
        }
    }
    void Update()
    {
        timer -= Time.deltaTime;
        if (timer <= 0)
        {
            CS_Projectile_Movement i = Instantiate(projectile, spawnLocation.position, spawnLocation.rotation, parent);
            i.angle = angle;
            if (rotateObject)
            {
                rotateObject.rotation = Quaternion.Euler(0.0f, 0.0f, angle - 90);
            }
            i.speed = projectileSpeed;
            timer   = spawnRate;

            angle = CS_Utils.Mod(angle + angleStep, 360);
        }
    }