Skip to content

Instantly share code, notes, and snippets.

@tkymx
tkymx / TimelineAssetClone.cs
Created March 7, 2021 08:27
CloneTimelineAsset の複製
private class TimelinePrivateMethodAndField : ITimelinePrivateMethodAndField
{
private readonly MethodInfo _timelineAddMethod;
private readonly MethodInfo _timelineRemoveMethod;
private readonly MethodInfo _trackAddMethod;
private readonly MethodInfo _trackRemoveMethod;
private readonly FieldInfo _trackParentField;
public TimelinePrivateMethodAndField()
{
@tkymx
tkymx / BasePage.cs
Created February 17, 2021 05:04
Timeline の実験
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Timeline;
using System;
[Serializable]
public class PageTransitionInfo
{
@tkymx
tkymx / day.swift
Created May 7, 2017 08:18
getToDay 何日前かを指定して日付をstringで取得、DateManager 日付と体重の組を管理(コンストラクタで乱数組作成)
func getToDay(day : Double = 0) -> String {
let now = Date( timeInterval: 60*60*24*day, since: Date() as Date )
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd"
return formatter.string(from: now as Date)
}
@tkymx
tkymx / Delaunay.cpp
Created October 21, 2016 09:41
ドロネイ三角形の作成
#include "opencv\cv.h"
#include "opencv\highgui.h"
#if CV_MAJOR_VERSION > 1
#include <opencv2/legacy/legacy.hpp>
#endif
//============================================================================
bool IsEdgeIn(int ind1, int ind2,
const std::vector<std::vector<int> > &edges)
@tkymx
tkymx / Depth.h
Last active June 19, 2016 09:19
キネクトから取得されたデプス情報を格納する テキストベースでちょっと重い
struct Depth
{
int m_w, m_h;
std::vector<std::vector<double>> depth;
public:
bool load_depth(std::string name)
{
//delete
if (!depth.empty())
std::vector<std::string> split(std::string text,std::string delim )
{
int index = 0, current = 0;
std::vector<std::string> strs;
while ((index = text.find_first_of(delim, current)) != std::string::npos)
{
strs.push_back(text.substr(current, index - current));
current = index + 1;
}
std::wstring_convert<std::codecvt_utf8<wchar_t> > m_codecvt_utf8;
return m_codecvt_utf8.from_bytes(str.c_str());
@tkymx
tkymx / get_dir_path.cpp
Last active May 22, 2016 10:19
ファイル読み込みダイアログ
#include <Windows.h>
#include <shlobj.h>
#include <map>
#include <iostream>
#include <fstream>
#include <string>
#include "utillity.h"
static int CALLBACK SHBrowseProc(HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
@tkymx
tkymx / Dxlib_template.cpp
Created March 19, 2015 15:12
Dxlib のテンプレート(自分用)
#include "DxLib.h"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
{
int Key;
SetGraphMode(640, 480, 16);
ChangeWindowMode(true);
if (DxLib_Init() == -1)
@tkymx
tkymx / Task.cpp
Last active December 15, 2015 21:49
CTask CTaskManager タスクの概念を実装するために用いる
#include "Task.h"
CTask::CTask(void)
{
}
CTask::~CTask(void)
{
}