21 lines
424 B
C#
21 lines
424 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Fireball : MonoBehaviour
|
|
{
|
|
public float speed = 1.0f;
|
|
public Vector2 destination;
|
|
|
|
void Start()
|
|
{
|
|
Debug.Log("Fireball destination:");
|
|
Debug.Log(destination);
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
float step = speed * Time.deltaTime;
|
|
transform.position = Vector3.MoveTowards(transform.position, destination, step);
|
|
}
|
|
}
|