View DynamicCreateMesh_3.cs
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; | |
[RequireComponent (typeof(MeshRenderer))] | |
[RequireComponent (typeof(MeshFilter))] | |
public class DynamicCreateMesh : MonoBehaviour | |
{ | |
[SerializeField] Material _colorMaterial; | |
private void Start () | |
{ |
View DynamicCreateMesh.cs
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; | |
[RequireComponent (typeof(MeshRenderer))] | |
[RequireComponent (typeof(MeshFilter))] | |
public class DynamicCreateMesh : MonoBehaviour | |
{ | |
[SerializeField] Material _colorMaterial; | |
private void Start () | |
{ |
View CustomPivot.cs
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 UnityEditor; | |
using UnityEngine; | |
/// <summary> | |
/// Sprite PivotをCustomに設定するサンプルコード | |
/// </summary> | |
public class CustomPivot : AssetPostprocessor | |
{ | |
private void OnPostprocessTexture(Texture2D target) | |
{ |
View localstorage.tsx
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
<TextArea onChange={(event) => { | |
const changedText = event.target.value | |
// save localStorage | |
localStorage.setItem("savekey", changedText) | |
}} | |
value = changedText | |
/> |
View downloadTask.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
NSURL *downloadURL = [NSURL URLWithString:path]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:downloadURL]; | |
self.downloadTask = [self.session downloadTaskWithRequest:request]; | |
[self.downloadTask resume]; |
View printExistFile.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
- (BOOL) printExistFile:(NSString*) targetFilePath | |
{ | |
// 【1. ファイルまでのパスを作成】 | |
// ダウンロードした画像が格納されたディレクトリパス取得(適宜変更してください) | |
NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
// ファイルパスの作成 | |
NSString *filePath = [[dirPaths objectAtIndex:0] stringByAppendingPathComponent:targetFilePath]; | |
// 【2. NSFileManagerを取得】 |
View existFile.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
// 【1. ファイルまでのパスを作成】 | |
// ダウンロードした画像が格納されたディレクトリパス取得(適宜変更してください) | |
NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
// ファイルパスの作成 | |
NSString *filePath = [[dirPaths objectAtIndex:0] stringByAppendingPathComponent:@"img.png"]; | |
// 【2. NSFileManagerを取得】 | |
NSFileManager *fileManager = [NSFileManager defaultManager]; |
View HelloWorldDOTween.cs
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; | |
using UnityEngine; | |
using DG.Tweening; | |
public class HelloWorldDOTween : MonoBehaviour | |
{ | |
void Start() | |
{ | |
transform.DOLocalMove(new Vector3(10f, 0, 0), 1f); | |
} |
View UIToolkit_DragAndDropTest.cs
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.UIElements; | |
/// <summary> | |
/// DragAndDrop Sample | |
/// </summary> | |
[RequireComponent(typeof(UIDocument))] | |
public class UIToolkit_DragAndDropTest : MonoBehaviour | |
{ | |
private Vector2 _dragOffset; |
View UIToolkit_MouseDownUpTest.cs
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.UIElements; | |
// 解説Qiita記事 : https://qiita.com/ohbashunsuke/items/ae1da96e582aef734eee | |
[RequireComponent(typeof(UIDocument))] | |
public class UIToolkit_MouseDownUpTest : MonoBehaviour | |
{ | |
void OnEnable() | |
{ | |
var document = GetComponent<UIDocument>(); |
NewerOlder