public Spiral(SpiralSettings settings) { step = settings.Step; angle = settings.Angle; previousPoint = null; Center = settings.Center; }
// Reset the effect to use the specified settings. // Except for the killCurrent option, this will only effect the // appearance of future spawns. public SpiralSettings resetEffect(bool killCurrent, SpiralSettings settings) { // If requested, destroy all current spawns of this effect. if (killCurrent) { killCurrentEffects(); } // Assign the new settings and then spawn a new effect with these settings. numberOfArms = settings.numArms; particlesPerArm = settings.numPPA; particleSeparation = settings.partSep; turnDistance = settings.turnDist; verticalTurnDistance = settings.vertDist; originOffset = settings.originOffset; turnSpeed = settings.turnSpeed; fadeValue = settings.fade; sizeValue = settings.size; SpawnEffect(); timeOfLastSpawn = Time.time; spawnCount++; return(getSettings()); }
private void HandleSpiralOption(int x, int y, ContainerBuilder builder) { var center = new Point(x, y); var spiralSettings = new SpiralSettings(center); builder.RegisterInstance(spiralSettings).As <SpiralSettings>(); }
// Reset the effect to use the specified settings. // Except for the killCurrent option, this will only effect the // appearance of future spawns. public SpiralSettings resetEffect(bool killCurrent, SpiralSettings settings) { // If requested, destroy all current spawns of this effect. if (killCurrent) { killCurrentEffects(); } // Assign the new settings and then spawn a new effect with these settings. m_nNumberOfArms = settings.numArms; m_nParticlesPerArm = settings.numPPA; m_fParticleSeparation = settings.partSep; m_fTurnDistance = settings.turnDist; m_fVerticalTurnDistance = settings.vertDist; m_fOriginOffset = settings.originOffset; m_fTurnSpeed = settings.turnSpeed; m_fFadeValue = settings.fade; m_fSizeValue = settings.size; SpawnEffect(); timeOfLastSpawn = NcController.GetEngineTime(); spawnCount++; return(getSettings()); }
public void GetNextPoint_ReturnOtherPoint_WhenNotFirstCall() { var center = new Point(22, 22); var settings = new SpiralSettings(center); var spiral = new Spiral(settings); var nextPoint = spiral.GetNextPoint(); nextPoint.Should().NotBeEquivalentTo(spiral.GetNextPoint()); }
// Loop Function -------------------------------------------------------------------- void Start() { m_fStartTime = GetEngineTime(); if (m_ParticlePrefab == null) { //ParticleEmitter emitter = GetComponent<ParticleEmitter>(); //if (emitter == null) // return; //emitter.emit = false; } // Record the current Inspector settings as the defaults. defaultSettings = getSettings(); }
public SpiralSettings resetEffect(bool killCurrent, SpiralSettings settings) { if (killCurrent) { this.killCurrentEffects(); } this.numberOfArms = settings.numArms; this.particlesPerArm = settings.numPPA; this.particleSeparation = settings.partSep; this.turnDistance = settings.turnDist; this.verticalTurnDistance = settings.vertDist; this.originOffset = settings.originOffset; this.turnSpeed = settings.turnSpeed; this.fadeValue = settings.fade; this.sizeValue = settings.size; this.SpawnEffect(); this.timeOfLastSpawn = Time.time; this.spawnCount++; return(this.getSettings()); }
public void GetNextPoint_ReturnPointСorrespondsSpiral_WhenManyCalls() { var spiralPoints = new List <Point>(); var center = new Point(22, 22); var settings = new SpiralSettings(center); var spiral = new Spiral(settings); var expectedSpiralPoints = new List <Point> { new Point(22, 22), new Point(21, 22), new Point(21, 21), new Point(22, 21) }; spiralPoints.Add(spiral.GetNextPoint()); spiralPoints.Add(spiral.GetNextPoint()); spiralPoints.Add(spiral.GetNextPoint()); spiralPoints.Add(spiral.GetNextPoint()); spiralPoints.Should().BeEquivalentTo(expectedSpiralPoints); }
public void Start() { // Record the current Inspector settings as the defaults. defaultSettings = getSettings(); }
// Reset the effect to use the specified settings. // Except for the killCurrent option, this will only effect the // appearance of future spawns. public SpiralSettings resetEffect(bool killCurrent, SpiralSettings settings) { // If requested, destroy all current spawns of this effect. if (killCurrent) { killCurrentEffects(); } // Assign the new settings and then spawn a new effect with these settings. numberOfArms = settings.numArms; particlesPerArm = settings.numPPA; particleSeparation = settings.partSep; turnDistance = settings.turnDist; verticalTurnDistance = settings.vertDist; originOffset = settings.originOffset; turnSpeed = settings.turnSpeed; fadeValue = settings.fade; sizeValue = settings.size; SpawnEffect(); timeOfLastSpawn = Time.time; spawnCount++; return getSettings(); }
public void Start() { this.defaultSettings = this.getSettings(); }
// Loop Function -------------------------------------------------------------------- void Start() { m_fStartTime = GetEngineTime(); if (m_ParticlePrefab == null) { ParticleEmitter emitter = GetComponent<ParticleEmitter>(); if (emitter == null) return; emitter.emit = false; } // Record the current Inspector settings as the defaults. defaultSettings = getSettings(); }