private void Shake(float frequency = 0.1f) { float perlin = Mathf.PerlinNoise(seed, Time.time * frequency); transform.localRotation = Quaternion.Euler(RandomL.GetRandomVector(baseVectorForRandomization) * perlin * trauma); if (trauma > 0) { trauma -= 1f * Time.deltaTime; } }
private void SpawnExplosion(Vector3 position, Vector3 normal) { Projectile[] projectiles = new Projectile[Amount]; Quaternion rotation = Quaternion.FromToRotation(Vector3.up, normal); for (int i = 0; i < Amount; i++) { projectiles[i] = Instantiate(Part, position + Vector3.up / 10, rotation); projectiles[i].GetComponent <Rigidbody>().AddForce(RandomL.GetRandomVector(Vector3.one) * Force); } }
public Vector3 GetVelocity(Vector3 position, Vector3 startModifier, float speed, Vector3 spread, Vector3 endModifier) { spread = RandomL.GetRandomVector(spread); return(TargetPositioner.GetVelocity(position + startModifier, speed, spread + endModifier)); }