Skip to content

Instantly share code, notes, and snippets.

@kurtdekker
Created December 27, 2022 05:35
Show Gist options
  • Select an option

  • Save kurtdekker/ae7c4c9f7152c363d6d58732175af0bb to your computer and use it in GitHub Desktop.

Select an option

Save kurtdekker/ae7c4c9f7152c363d6d58732175af0bb to your computer and use it in GitHub Desktop.
a way to put design elements in your Unity scene so they disappear when you play.
using UnityEngine;
// @kurtdekker - Attach this script to GameObjects you
// want to have in your scene for alignment and design,
// but you want to be destroyed during real gameplay.
public class DestroyOnAwake : MonoBehaviour
{
void Awake()
{
// and you can comment this out and run and you will have
// all your guides still in project at runtime!!
Destroy(gameObject);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment