Skip to content

Instantly share code, notes, and snippets.

@enue
Last active December 15, 2016 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enue/0afbf0c3d52d82d8a545577f719a360d to your computer and use it in GitHub Desktop.
Save enue/0afbf0c3d52d82d8a545577f719a360d to your computer and use it in GitHub Desktop.
[Unity]Billboard
using UnityEngine;
using System.Collections;
namespace TSKT
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
[RequireComponent(typeof(Renderer))]
public class Billboard : MonoBehaviour
{
// Rendererが有効でなければ呼ばれないことに注意
void OnWillRenderObject()
{
transform.rotation = Camera.current.transform.rotation;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment