init
This commit is contained in:
commit
341a877b4a
2338 changed files with 1346408 additions and 0 deletions
13
Assets/NavMesh/Examples/Scripts/SpawnPrefabOnKeyDown.cs
Normal file
13
Assets/NavMesh/Examples/Scripts/SpawnPrefabOnKeyDown.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class SpawnPrefabOnKeyDown : MonoBehaviour
|
||||
{
|
||||
public GameObject m_Prefab;
|
||||
public KeyCode m_KeyCode;
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(m_KeyCode) && m_Prefab != null)
|
||||
Instantiate(m_Prefab, transform.position, transform.rotation);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue