Last active
December 15, 2016 12:45
-
-
Save enue/0afbf0c3d52d82d8a545577f719a360d to your computer and use it in GitHub Desktop.
[Unity]Billboard
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
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