KITASENJU DESIGN BLOG

memo, html, javascript, unity

Entries from 2022-09-12 to 1 day

RenderTextureをpngに保存(高速版)

save render texture as png pngとして画像を保存 using System.IO; using UnityEngine; using UnityEngine.Assertions; using UnityEngine.Rendering; using UnityEngine.UI; public class RenderTex2PNG : MonoBehaviour { [SerializeField] private Rende…

rayを使わずマウス位置を取得

Vector3 getMousePos(){ var p = Input.mousePosition; _mousePos.x = 2f*(p.x / (float)Screen.width - 0.5f); _mousePos.y = 2f*(p.y / (float)Screen.height -0.5f); float screenH = (float)_camera.orthographicSize;//OrthographicCameraにおける高さ …

"FOOTER"