public void Reset() { tr.emitting = false; throwableParticle.SetAcceleration(0, 0, 0); throwableParticle.SetVelocity(0, 0, 0); throwableParticle.ClearAccumulator(); throwableParticle.SetPosition(startPos.x, startPos.y, startPos.z); boundingRectangle.center = throwableParticle.GetPosition(); }
public void SpringPopup() { if (!gameManager.isTriggeredOnce) { particle.SetAcceleration(0, 0, 0); particle.SetVelocity(0, 0, 0); particle.ClearAccumulator(); particle.SetPosition(eventPoint.x, eventPoint.y, eventPoint.z); gameManager.jetpackFuel = 100f; gameManager.downwardsGravity = true; gameManager.controlMode = GameManager.ControlMode.noControl; gameManager.textPanel.SetActive(true); gameManager.text.text = "There is an obstacle Bob can't pass without his jetpack. He needs to hit the trigger on the other side to pass."; } }
public AmmoRound(ShotType type) { this.type = type; switch (type) { case ShotType.Pistol: Particle.Mass = 2.0f; // 2.0kg Particle.Velocity = new Vector3(0.0f, 0.0f, 35.0f); // 35m/s Particle.Acceleration = new Vector3(0, -1, 0); Particle.Damping = 0.99f; break; case ShotType.Artillery: Particle.Mass = 200.0f; // 200.0kg Particle.Velocity = new Vector3(0.0f, 30.0f, 40.0f); // 50m/s Particle.Acceleration = new Vector3(0, -20, 0); Particle.Damping = 0.99f; break; case ShotType.Fireball: Particle.Mass = 1.0f; // 1.0kg - mostly blast damage Particle.Velocity = new Vector3(0.0f, 0.0f, 10.0f); // 5m/s Particle.Acceleration = new Vector3(0, 0.6f, 0); // floats up Particle.Damping = 0.9f; break; case ShotType.Laser: // Note that this is the kind of laser bolt seen in films, // not a realistic laser beam! Particle.Mass = 0.1f; // 0.1kg - almost no weight Particle.Velocity = new Vector3(0.0f, 0.0f, 100.0f); // 100m/s Particle.Acceleration = new Vector3(0.0f, 0.0f, 0.0f); // No gravity Particle.Damping = 0.99f; break; } // Set the data common to all particle types Particle.Position = new Vector3(0.0f, 1.5f, 0.0f); StartTime = TimingData.LastFrameTimestamp; // Clear the force accumulators Particle.ClearAccumulator(); }