ホログラムを作ってみたり
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class BillboardScript : MonoBehaviour
|
||||
{
|
||||
[Tooltip("Locks the rotational up axis of the billboard.")]
|
||||
public bool lockUpAxis = true;
|
||||
private Camera camera;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
camera = Camera.main;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (lockUpAxis)
|
||||
{
|
||||
gameObject.transform.eulerAngles = new Vector3(gameObject.transform.eulerAngles.x, camera.transform.eulerAngles.y + 180, gameObject.transform.eulerAngles.z);
|
||||
}
|
||||
else {
|
||||
gameObject.transform.LookAt(camera.transform.position);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f771f729641d6024f91e0ec722b9f129
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 214635
|
||||
packageName: (LITE) Splash of Color - Unique Photogrammetry Plants
|
||||
packageVersion: 1.0
|
||||
assetPath: Assets/(LITE) Splash of Color - Unique Photogrammetry Plants/Script/BillboardScript.cs
|
||||
uploadId: 483360
|
||||
Reference in New Issue
Block a user