Skip to content

Instantly share code, notes, and snippets.

public class SceneControler2 : MonoBehaviour {
DrawGraph dg;
AnimationSinVectorMesh animSin;
void Awake () {
GameObject go = Instantiate(Resources.Load("DrawGraph")) as GameObject;
dg = go.GetComponent<DrawGraph>();
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public class GridObj : MonoBehaviour
{
public Rect gridSize = new Rect(-0.5f, -0.5f, 1, 1);
public Color gridColor = new Color(0f, 0f, 0f);
public int gridDivid = 20; //グリッドの分割数。偶数に設定する事
//このシェーダーは法線に基づいてメッシュを着色します。頂点入力として、appdata_base を使用します
//出典:https://docs.unity3d.com/ja/current/Manual/SL-VertexProgramInputs.html
Shader "tutorial/VertexInputSimple" {
SubShader{
Pass{
CGPROGRAM
//頂点シェーダーとフラグメントシェーダーのプログラミング
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpherePos : MonoBehaviour
{
public Transform targetTransform;
public float radius, theta, phi, speed;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Vector2SpherePos : MonoBehaviour
{
void Start()
{
//デカルト座標
Vector3 pos = new Vector3(1f, 4f, 2f);
@Osinko
Osinko / TargetDigit
Created May 1, 2017 11:18
狙った桁の抽出
using UnityEngine;
using System.Collections;
public class TargetDigit : MonoBehaviour
{
void Start()
{
print(Digit(123456789, 6)); //7桁目を表示(変数digは0を含んでカウントしている)
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using System.Net;
using System.Xml;
//公式資料
//https://partner.steamgames.com/doc/webapi
@Osinko
Osinko / gist:48e071c8a2e3938548727d621b95c9c5
Created October 24, 2017 05:22
maxima用コード 6の倍数関連
amari:1$
for a:0 thru 6 do
for b:0 thru 6 do
(
amari:divide(divide((6*k+a)*(6*k+b),6*k)[2],6)[2],
/* C#の「!=」はmaximaでは「#」 */
if (amari#0) then
print("x=",(6*k+a),
",y=",(6*k+b),
",xy=",ratsimp((6*k+a)*(6*k+b)),
@Osinko
Osinko / nCr
Created January 9, 2018 07:03
組合せ計算
//組合せ計算
public int nCr(int n, int r)
{
if (n == r || r == 0) return 1;
int deno = n;
int nume = 1;
for (int i = 2; i <= r; n--, i++)
{
deno *= (n - 1);
@Osinko
Osinko / DD
Created January 9, 2018 07:07
値から特定桁の数字を抽出
using UnityEngine;
using System.Collections;
public class DD : MonoBehaviour
{
void Start()
{
print(Digit(123456789, 6)); //7桁目を表示(変数digは0を含んでカウントしている)
}