1
Fork 0
mirror of https://github.com/Steffo99/beat-td.git synced 2024-11-21 23:04:19 +00:00

Create prefab placer

This commit is contained in:
Steffo 2018-04-21 13:01:00 +02:00
parent 3d9cf176b2
commit 80b9ac2bb1
3 changed files with 30 additions and 0 deletions

View file

@ -60,6 +60,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\Scripts\AlignToGridContinuous.cs" />
<Compile Include="Assets\Scripts\InstantiateOnClick.cs" />
<Compile Include="Assets\Scripts\PositionFromMouse.cs" />
<Reference Include="UnityEditor.StandardEvents">
<HintPath>C:/Users/stepi/Code/ld41/Library/ScriptAssemblies/UnityEditor.StandardEvents.dll</HintPath>

View file

@ -0,0 +1,18 @@
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)
{
Instantiate(original, transform.position, transform.rotation);
}
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 081ef29388dfb6347a06f44d55a176d8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: