示例#1
0
        public void Start()
        {
            Debug.Log("WAP: Begin Autopilot.Start");

            Texture launcherButtonTexture =
                GameDatabase.Instance.GetTexture("WarrigalsAutopilot/wap-icon", asNormalMap: false);

            _appLauncherButton          = ApplicationLauncher.Instance.AddModApplication(
                onTrue: () => _showGui  = true,
                onFalse: () => _showGui = false,
                onHover: null,
                onHoverOut: null,
                onEnable: null,
                onDisable: null,
                visibleInScenes: ApplicationLauncher.AppScenes.FLIGHT,
                texture: launcherButtonTexture
                );

            _bankController            = new BankController(ActiveVessel);
            _bankController.OnDisable += () => _headingController.Enabled = false;

            _headingController           = new HeadingController(ActiveVessel, _bankController);
            _headingController.OnEnable += () => _bankController.Enabled = true;

            _pitchController            = new PitchController(ActiveVessel);
            _pitchController.OnDisable += () =>
            {
                _vertSpeedController.Enabled    = false;
                _speedByPitchController.Enabled = false;
            };

            _vertSpeedController           = new VertSpeedController(ActiveVessel, _pitchController);
            _vertSpeedController.OnEnable += () =>
            {
                _pitchController.Enabled        = true;
                _speedByPitchController.Enabled = false;
            };
            _vertSpeedController.OnDisable += () =>
            {
                _altitudeController.Enabled = false;
            };

            _altitudeController           = new AltitudeController(ActiveVessel, _vertSpeedController);
            _altitudeController.OnEnable += () =>
            {
                _vertSpeedController.Enabled = true;
            };

            _speedByPitchController           = new SpeedByPitchController(ActiveVessel, _pitchController);
            _speedByPitchController.OnEnable += () =>
            {
                _pitchController.Enabled     = true;
                _vertSpeedController.Enabled = false;
            };

            Debug.Log("WAP: End Autopilot.Start");
        }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     originalScale = transform.localScale;
     //anim = this.GetComponent<Animator>();
     sb            = FindObjectOfType <SpawnerBehaviour>();
     sr            = this.GetComponent <SpriteRenderer>();
     sm            = FindObjectOfType <ScoreManager>();
     pc            = FindObjectOfType <PitchController>();
     originalColor = sr.color;
 }