개발 (12) 썸네일형 리스트형 [C#] GetDefaultValue public static T GetDefaultValue() { // We want an Func which returns the default. // Create that expression here. Expression e = Expression.Lambda( // The default value, always get what the *code* tells us. Expression.Default(typeof(T)) ); // Compile and return the value. return e.Compile()(); } public static object GetDefaultValue(this Type type) { // Validate parameters. if (type == null) thro.. [Unity] 스크립트 통해 Scene View 카메라 조작 커스텀 에디터를 만들다 보면 특정 조건에서 씬뷰의 카메라를 내가 원하는 위치와 각도로 제한하고 싶은 경우가 있는데 아래와 같은 코드를 통해 씬뷰의 카메라를 제어 할 수 있다. using UnityEditor; var sceneView = SceneView.lastActiveSceneView; sceneView.rotation = Quaternion.Euler(new Vector3(90, 0, 0)); sceneView.pivot = Vector3.zero; sceneView.size = 50; sceneView.orthographic = true; forum.unity.com/threads/moving-scene-view-camera-from-editor-script.64920/ Moving scene .. [Unity] newtonsoft Json.NET www.newtonsoft.com/json/help/html/SerializeTypeNameHandling.htm TypeNameHandling setting This sample uses the TypeNameHandling setting to include type information when serializing JSON and read type information so that the create types are created when deserializing JSON. www.newtonsoft.com stackoverflow.com/questions/6348215/how-to-deserialize-json-into-ienumerablebasetype-with-newtonsoft-json-.. [Python] sqlalchemy - 외래키 설정 from sqlalchemy import ForeignKey class User(Base): __tablename__ = 'user' id = db.Column(db.Integer, primary_key=True) class EventUser(Base): __tablename__ = "event_user" user_id = db.Column(db.Integer, ForeignKey("user.id"), nullable=False) - row > 딕셔너리(json) 변환 및 특정 데이터 삭제 class User(Base): __tablename__ = "user" username = db.Column(db.String(100), unique=True, nullable=False) passw.. [Unity] SQLite 사용 샘플 코드 DB 부모 클래스 using SQLite4Unity3d; using UnityEngine; namespace DB { public class DBBase { [PrimaryKey, AutoIncrement] public int Id { get; set; } public DBBase() { } } } DB 서비스 클래스 using System; using System.Collections.Generic; using System.Linq.Expressions; using SQLite4Unity3d; using UnityEngine; #if !UNITY_EDITOR using System.Collections; using System.IO; #endif namespace DB { public class Dat.. [C#] .cs to .dll 1. Developer Command Prompt for VS 2019 실행 2. csc -target:library TargetCSFile.cs https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/command-line-building-with-csc-exe Command-line build with csc.exe Command-line build with csc.exe In this article --> You can invoke the C# compiler by typing the name of its executable file (csc.exe) at a command prompt. If you use.. [Unity] 유용한 애셋 Utility - 로컬라이징 https://assetstore.unity.com/packages/tools/localization/i2-localization-14884?aid=1100l355n&gclid=CjwKCAjwgdX4BRB_EiwAg8O8Hc_2BWVI0oeDxfmKIZp8clcrbw1IxDBu-EMGhH6_MR4f4_6Puncp6hoCtl4QAvD_BwE&pubref=UnityAssets%2ADyn03%2A1723478829%2A67594162255%2A336302044055%2Ag%2A%2A%2Ab%2Ac%2Agclid%3DCjwKCAjwgdX4BRB_EiwAg8O8Hc_2BWVI0oeDxfmKIZp8clcrbw1IxDBu-EMGhH6_MR4f4_6Puncp6hoCtl4QAvD_BwE&ut.. [Javascript] 파일 다운로드 function fileDownload(url, name) { var req = new XMLHttpRequest(); req.open("GET", url, true); req.responseType = "arraybuffer"; req.onload = function () { var arrayBuffer = req.response; var blob = new Blob([arrayBuffer]); if (navigator.appVersion.toString().indexOf('.NET') > 0) window.navigator.msSaveBlob(blob, name); else { var url = URL.createObjectURL(blob); var a = $(""); a.attr("href", ur.. 이전 1 2 다음