// [SerializeField] // Start is called before the first frame update void Start() { capsuleCollider = GetComponent <CapsuleCollider>(); myRig = GetComponent <Rigidbody>(); tr = GetComponent <Transform>(); theGunCtrl = FindObjectOfType <GunCtrl>(); theCrosshair = FindObjectOfType <Crosshair>(); // localPosition을 쓰는 이유는 월드기준이 아닌 플레이어 기준 // 월드기준에서 y값을 0으로 맞추면 땅에 박힘, 플레이어 기준에서 0은 캐릭터의 중간정도. // 초기화 applySpeed = walkSpeed; originPosY = theCamera.transform.localPosition.y; applyCrouchPosY = originPosY; }
public void SetClass(ClassState _class) //클래스 장비 부분 { nowClass = _class; switch (_class) { case ClassState.Guardian: health = gHealth; attack = gAttack; nowGun = Instantiate(gGun, transform); nowShield = Instantiate(shield, transform); break; case ClassState.Surprise: health = sHealth; attack = sAttack; nowGun = Instantiate(sGun, transform); break; } }
void Start() { instance = this; fireLight.GetComponent <Light>().enabled = false; _audio = GetComponent <AudioSource>(); }
private void Start() { MyGun = GetComponentInChildren <GunCtrl>(); Line = GetComponentInChildren <LineRenderer>(); Line.enabled = false; }