mirror of
https://github.com/Steffo99/beat-td.git
synced 2024-11-25 16:54:18 +00:00
Create prefab placer
This commit is contained in:
parent
3d9cf176b2
commit
80b9ac2bb1
3 changed files with 30 additions and 0 deletions
|
@ -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>
|
||||
|
|
18
Assets/Scripts/InstantiateOnClick.cs
Normal file
18
Assets/Scripts/InstantiateOnClick.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/InstantiateOnClick.cs.meta
Normal file
11
Assets/Scripts/InstantiateOnClick.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 081ef29388dfb6347a06f44d55a176d8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in a new issue