Skip to content

Instantly share code, notes, and snippets.

public IEnumerator ShareScreenShot()
{
string fileName = System.DateTime.Now.ToString("ScreenShot yyyy-MM-dd HH.mm.ss") + ".png";
string imagePath = Application.persistentDataPath + "/" + fileName;
ScreenCapture.CaptureScreenshot(fileName);
yield return new WaitForEndOfFrame();
string text = "ツイート内容\n#hashtag ";
//src_img : 入力画像
void MaxArea_Moment(Mat src_img) {
Mat input;
cvtColor(src_img, input, CV_BGR2GRAY);
Mat Labelmg;
Mat stats;
Mat centroids;
int nLab = connectedComponentsWithStats(input, Labelmg, stats, centroids);
int Max = 0;
int MaxID = 0;
public static class Sample
{
public static void AddMethod(this 拡張したいクラス self )
{
//処理
}
}
public static class Sample
{
public static void AddMethod(this 拡張したいクラス self , int v)
{
//処理
}
}
public static class Sample
{
public static void process(this PlayerPrefs self)
{
//処理
}
}
void Start()
{
PlayerPrefs.process(); <-- これは不可能
PlayerPrefs p = new PlayerPrefs();
p.process(); <--これは可能
}
void Start()
{
SpriteRenderer s = gameObject.GetComponent<SpriteRenderer>();
//Sprite
s.sprite = Resources.Load<Sprite>("Image FilePath");
//Color
s.color = new Color(1.0f, 1.0f, 1.0f, 1.0f);//(r,g,b,a);
//0 <= r,g,b,a <= 1.0f
public class Clock : MonoBehaviour
{
public bool isProgress = true;
public GameObject HourHandle;
public GameObject MinHandle;
public int hour;
public int min;
void setup(){
size(1000,1000);
background(255,255,255);
Draw_val();
}
void Draw_val(){
float one_rad = 360 / 60;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
public class ShapeRenderer : MonoBehaviour {
private Dictionary<string, int> ShapeKeyList;
public void SetMesh(GameObject TargetObject)