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; | |
public class AsyncTextureCreator : MonoBehaviour | |
{ | |
public int width = 128; | |
public int height = 32; | |
} |
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
const https = require('https'); | |
const apiKey = require('./secret.js').key; | |
const input = process.argv.length > 2 ? process.argv[2] : 'sphere'; | |
const options = { | |
hostname: 'api.openai.com', | |
port: 443, | |
path: '/v1/chat/completions', | |
method: 'POST', | |
headers: { |
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; | |
namespace WeddingMovie | |
{ | |
public class ColorChanger : MonoBehaviour | |
{ | |
public Color color = Color.white; | |
[ContextMenu("ChangeColor")] |
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 System.Collections.Generic; | |
using UnityEngine; | |
public class VoiceSpeaker : MonoBehaviour | |
{ | |
private List<float> _buffer = new List<float>(); | |
private object _lockObject = new object(); | |
private AudioSource _source; | |
private AudioClip _speakerClip; |
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
... | |
var window = uwcWinObj.window; | |
var localPos = uwcWinObj.transform.InverseTransformPoint(targetHit_.point); | |
var windowLocalX = (int)((localPos.x + 0.5f) * window.width); | |
var windowLocalY = (int)((0.5f - localPos.y) * window.height); | |
var desktopX = window.x + windowLocalX; | |
var desktopY = window.y + windowLocalY; | |
var coord = new Vector2(desktopX, desktopY); | |
NwndWin32API.SetForegroundWindow(window.handle); |
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
// Ref: http://7cc.hatenadiary.jp/entry/hatena-source-line | |
(function(document) { | |
var pres = document.getElementsByTagName('pre'); | |
for (var i = pres.length; i--;) { | |
var elem = makeLineNumber(pres[i]); | |
pres[i].appendChild(elem); | |
} |
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; | |
public class SerialCube : MonoBehaviour | |
{ | |
public SerialHandler serialHandler; | |
public float threshold = 30f; | |
public Vector3 velocity = new Vector3(0f, 0.5f, 0f); | |
void Start() | |
{ |
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
#include <iostream> | |
#include <queue> | |
using namespace std; | |
int main() | |
{ | |
int N, M; | |
cin >> N >> M; |
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
#ifndef RAYMARCHING_CGINC | |
#define RAYMARCHING_CGINC | |
#include "UnityCG.cginc" | |
#include "./Camera.cginc" | |
#include "./Utils.cginc" | |
#ifndef DISTANCE_FUNCTION | |
inline float _DefaultDistanceFunction(float3 pos) | |
{ |
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
inline float DistanceFunction(float3 wpos, RaymarchInfo ray) | |
{ | |
float3 scenePos = ray.startPos + (ray.sceneDepth - ray.totalLength) * ray.rayDir; | |
float d1 = Sphere(wpos - scenePos, 0.01); | |
float d2 = Sphere(wpos - unity_ObjectToWorld._m03_m13_m23, 0.5); | |
return SmoothMin(d1, d2, 1.0); | |
} |
NewerOlder