c#3 표창 던지기 표창이 회전하면서 y축으로 이동하기 using UnityEngine; public class StarMove : MonoBehaviour { private float speed = 0; //이동속도 [SerializeField] private float rotateSpeed = 0; //회전속도 private Vector3 startPosition; //시작시점 void Update() { if (Input.GetMouseButtonDown(0)) { this.startPosition = Input.mousePosition; //시작시점 } else if (Input.GetMouseButtonUp(0)) { Vector3 endPosition = Input.mousePosition; //종료시점 // 마.. 2024. 1. 28. 벡터 연산의 이해 using System.Collections; using System.Collections.Generic; using UnityEngine; public class App : MonoBehaviour { [SerializeField] private Transform a; //멤버변수 [SerializeField] private Transform b; private void Start() { //두 벡터의 뺄셈 연산 //연산 결과 : 방향 벡터 (새로운) Vector3 c = b.position - a.position; //벡터의 방향과 길이 DrawArrow.ForDebug(a.position, c, 10, Color.red); } } 2024. 1. 25. 디아블로 아이템 사전에서 아이템 찾아서 출력 해오기 코드작성 using System.Xml.Linq; using System; using System.Collections.Generic; namespace Diablo { public class Dagger { string name; float dps; int minDamage; int maxDamage; float aps; // 생성자 public Dagger() { } public Dagger(string name, float dsp, int minDamage, int maxDamage, float aps) { this.name = name; this.dps = dsp; this.minDamage = minDamage; this.maxDamage = maxDamage; this.aps = aps; } .. 2024. 1. 24. 이전 1 다음