void Update() { int layerMask = 1 << 13; //layerMask = ~layerMask; Physics.Raycast(transform.position, transform.forward, out hit, 1000, layerMask); if (GrabAction.GetStateDown(handType)) { if (hit.collider) { if (hit.collider.CompareTag("Turret")) { hit.collider.gameObject.GetComponent <TurretBehaviour>().enabled = false; MuzzleEffect muzzle = hit.collider.gameObject.GetComponent <MuzzleEffect>(); muzzle.enabled = true; muzzle.handType = handType; muzzle.lookAt.ObjectToLookAt = AimTurret.objectToFollow; muzzle.AddStates(); } } } Debug.DrawRay(transform.position, transform.forward, Color.yellow); }
public WeaponGun SetDefault() { itemName = "Unique Name"; price = 0; inventoryIcon = "inventoryIcon.png"; maxStack = 1; rarity = "common"; description = "Description of the weapon"; shortdescription = "Name of the weapon"; image = "image.png"; handPosition = new List<int>() { 0, 0 }; firePosition = new List<int>() { 20, 5 }; recoilTime = 1.0; level = 1; tooltipKind = "gun"; weaponType = "Custom Gun"; itemTags = new List<string>(); fireTime = 2.0; inaccuracy = 0.05; twoHanded = false; walkWhileFiring = false; projectileType = "Custom Projectile"; powerProjectileType = "Charged Custom Projectile"; powerProjectileTime = new List<double>() { 0.9, 60 }; drawSpeedCurve = "drawTimeMultiplier"; drawPowerCurve = "drawTimeMultiplier"; projectile = new Projectile(80, 0, 5, new List<int>() { 255, 255, 255 }); muzzleEffect = new MuzzleEffect(new List<FireSound>() { new FireSound("/sfx/gun/something.ogg") }); return this; }
public WeaponStaff SetDefault() { itemName = "Unique Name"; inventoryIcon = "inventoryIcon.png"; maxStack = 0; rarity = "common"; description = "Description of the weapon"; shortdescription = "Name of the weapon"; image = "image.png"; handPosition = new List<double>() { 0, 0 }; firePosition = new List<double>() { 20, 5 }; level = 10; fireTime = 1.0; windupTime = 1.0; cooldown = 1; twoHanded = true; fireOnRelease = true; swingStart = 10; swingFinish = 0; coolingDownAngle = 0; projectileType = "Custom Projectile"; projectile = new Projectile(10, 5, new List<int>() { 255, 255, 255 }); muzzleEffect = new MuzzleEffect(new List<FireSound>() { new FireSound("/sfx/gun/something.ogg")}); level1ChargeTime = 0.5; level2ChargeTime = 1; staffChargingGlow = new StaffChargingGlow("staffglow.png", 10, 1, 2, 3, 0.25, new List<int>() { 0, 5 }); return this; }