1
Fork 0
mirror of https://github.com/Steffo99/beat-td.git synced 2024-11-25 16:54:18 +00:00
beat-td/Assets/Scripts/InstantiateOnClick.cs

20 lines
477 B
C#
Raw Normal View History

2018-04-21 11:01:00 +00:00
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)
{
2018-04-21 12:09:09 +00:00
Vector3 position = new Vector3(transform.position.x, transform.position.y, 0);
Instantiate(original, position, transform.rotation);
2018-04-21 11:01:00 +00:00
}
}
}
}