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 SaveTexture : MonoBehaviour | |
{ | |
private byte[] SaveRenderTextureAsPng(RenderTexture rt) | |
{ | |
if (rt == null || !rt.IsCreated()) return null; | |
// Allocate |
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 Utils | |
{ | |
public static class CameraExtensions | |
{ | |
private static readonly float HalfDiagonalOf35Millimeter = Mathf.Sqrt(36 * 36 + 24 * 24) * 0.5f; | |
public static float Get35MillimeterFocalLength(this Camera camera) | |
{ |
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 UnityEngine.Rendering; | |
public class AAA : MonoBehaviour | |
{ | |
[SerializeField] private Mesh _mesh; | |
[SerializeField] private Material _material; | |
private Matrix4x4[] _matrices; | |
private void OnEnable() |
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
Shader "SantarhTemplate" | |
{ | |
Properties | |
{ | |
} | |
SubShader | |
{ | |
Tags { "RenderType" = "Opaque" "Queue" = "Geometry" } |
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
# This example assumes we have a mesh object in edit-mode | |
import bpy | |
import bmesh | |
from mathutils import Vector | |
# Get the active mesh | |
obj = bpy.context.edit_object | |
me = obj.data |
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 Foo | |
{ | |
private readonly int _hoge; | |
public Foo(GameObject target, int hoge) | |
{ | |
_hoge = hoge; | |
target.AddComponent<FooBehaviour>().Init(this); |
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; | |
using System.IO; | |
using System.Text; | |
public class Test | |
{ | |
public static void Main() | |
{ | |
// your code goes here | |
string str_unicode = "あいうえお"; // (あ)0x3042, (い)0x3044 ... |
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
#!/usr/local/bin/ruby | |
# -*- encoding: utf-8 -*- | |
require "rubygems" | |
require "mechanize" | |
class Pixiv | |
attr_accessor :agent | |
attr_accessor :my_id |
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
#!/usr/local/bin/ruby | |
# -*- encoding: utf-8 -*- | |
require "rubygems" | |
require "mechanize" | |
class Pixiv | |
attr_accessor :agent | |
def initialize |
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
#!/usr/local/bin/ruby | |
require "rubygems" | |
require "mechanize" | |
require "termcolor" | |
class Mean | |
attr_reader :text | |
def initialize word_class, text | |
@word_class = word_class |
NewerOlder