목록2023/07 (25)
아카이브

스크립트 using System.Collections; using System.Collections.Generic; using UnityEngine; public class RouletteControler : MonoBehaviour { float rotSpeed = 0; //회전속도 void Start() { } // Update is called once per frame void Update() { //왼쪽버튼 눌렀다면 if(Input.GetMouseButtonDown(0)) { this.rotSpeed = 10; } //회전 속도 만큼 룰렛을 회전시킨다. transform.Rotate(0, 0, this.rotSpeed); } } 결과 회전속도 줄이기 rotSpeed 값에 감쇠계수 0.96을 곱하..

Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LearnJson { internal class Program { static void Main(string[] args) { //new키워드: App클래스의 인스턴스 생성하고 생성자 호출 new App(); } } } App.cs using Newtonsoft.Json; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using..
program.cs using System; namespace LearnDotnet { internal class Program { static void Main(string[] args) { //new키워드: App클래스의 인스턴스 생성하고 생성자 호출 new App(); } } } App.cs using System; using System.IO; using Newtonsoft.Json; using System.Collections.Generic; using System.Linq; namespace LearnDotnet { public class App { private Game game; //생성자 public App() { DataManager.instance.LoadItemDatas(); Dat..

Hero.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LearnDotnet { public class Hero { public int hp; public int maxHp; //생성자 public Hero() { this.hp = 30; this.maxHp = this.hp; } //남은체력 public void HitDamage(int damage, Action callback) { this.hp -= damage; Console.WriteLine("공격받았습니다. {0}만큼 hp가 깎입니다.",damage); call..