public void SetUp(PulseGun gun, ProjectileSettings settings) { this.gun = gun; this.settings = settings; fixedRotation = Quaternion.Inverse(gun.transform.rotation) * transform.rotation; rigidbody.drag = Mathf.Infinity; rigidbody.angularDrag = Mathf.Infinity; //rigidbody.useGravity = false; Material newMaterial = renderer.material; Color newColor = color; newColor.a = settings.transparency / 255f; newMaterial.SetColor(COLOR, newColor); newMaterial.SetFloat(BLUR, settings.blur); renderer.material.Lerp(renderer.material, newMaterial, 1f); }
private void Start() { Cursor.lockState = CursorLockMode.Locked; pulseGun = GetComponent <PulseGun>(); pulsePack = GetComponent <PulsePack>(); }