mirror of
https://github.com/Steffo99/beat-td.git
synced 2024-11-23 15:54:18 +00:00
19 lines
477 B
C#
19 lines
477 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class InstantiateOnClick : MonoBehaviour
|
|
{
|
|
public GameObject original = null;
|
|
|
|
void Update () {
|
|
if (Input.GetMouseButtonDown(0))
|
|
{
|
|
if (original != null)
|
|
{
|
|
Vector3 position = new Vector3(transform.position.x, transform.position.y, 0);
|
|
Instantiate(original, position, transform.rotation);
|
|
}
|
|
}
|
|
}
|
|
}
|