Last active
September 7, 2018 10:34
-
-
Save sergiobd/6954543d0876ad332af8a33a0f635d0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For use with the holographic projection tutorial at www.sbromberg.co | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class CreateSmallCube : MonoBehaviour { | |
public Transform cubeParent; | |
void Update () { | |
if (Input.GetKeyDown(KeyCode.Space)) | |
{ | |
GameObject smallCube = GameObject.CreatePrimitive(PrimitiveType.Cube); | |
smallCube.transform.position = transform.position; | |
smallCube.transform.localScale = 0.1f*Vector3.one; | |
smallCube.transform.parent = cubeParent; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment