コード例 #1
0
 public Spiral(SpiralSettings settings)
 {
     step          = settings.Step;
     angle         = settings.Angle;
     previousPoint = null;
     Center        = settings.Center;
 }
コード例 #2
0
    // 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());
    }
コード例 #3
0
        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>();
        }
コード例 #4
0
    // 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());
    }
コード例 #5
0
        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());
        }
コード例 #6
0
    // 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();
    }
コード例 #7
0
 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());
 }
コード例 #8
0
        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);
        }
コード例 #9
0
 public void Start()
 {
     // Record the current Inspector settings as the defaults.
     defaultSettings = getSettings();
 }
コード例 #10
0
    // 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();
    }
コード例 #11
0
 public void Start()
 {
     // Record the current Inspector settings as the defaults.
     defaultSettings = getSettings();
 }
コード例 #12
0
 public void Start()
 {
     this.defaultSettings = this.getSettings();
 }
コード例 #13
0
	// 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();
	}