Esempio n. 1
0
        // pseudo-ctor
        public override void OnStart(StartState state)
        {
            // don't break tutorial scenarios
            if (Lib.DisableScenario(this))
            {
                return;
            }

            // get animations
            deploy_anim = new Animator(part, deploy);

            if (rotateIsTransform)
            {
                rotate_transf = new Transformator(part, rotate, SpinRate, SpinAccelerationRate);
            }
            else
            {
                rotate_anim = new Animator(part, rotate);
            }

            if (counterWeightRotateIsTransform)
            {
                counterWeightRotate_transf = new Transformator(part, counterWeightRotate, counterWeightSpinRate, counterWeightSpinAccelerationRate, false);
            }
            else
            {
                counterWeightRotate_anim = new Animator(part, counterWeightRotate);
            }

            // set animation state / invert animation
            deploy_anim.Still(deployed ? 1.0f : 0.0f);
            deploy_anim.Stop();

            Update();
        }
Esempio n. 2
0
		// pseudo-ctor
		public override void OnStart(StartState state)
		{
			// don't break tutorial scenarios
			if (Lib.DisableScenario(this)) return;

			// get animations
			deploy_anim = new Animator(part, deploy);
			rotate_anim = new Animator(part, rotate);

			// if is using Transform
			rotate_transf = new Transformator(part, rotate, SpinRate, SpinAccelerationRate);

			// set animation state / invert animation
			deploy_anim.still(deployed ? 1.0f : 0.0f);
			deploy_anim.stop();

			if (deployed)
			{
				rotate_transf.Play();
				rotate_anim.play(false, true);
			}

			// show the deploy toggle if it is deployable
			Events["Toggle"].active = deploy.Length > 0;
		}