示例#1
0
        private Script[] CreateTurretAIScripts(ProgressBar cooldownBar, GameObject target)
        {
            TurretAIControlScript  turretControl  = new TurretAIControlScript(2);
            ShootAIControlScript   shootControl   = new ShootAIControlScript(this, 500);
            AIRocketSwitcherScript rocketSwitcher = new AIRocketSwitcherScript(100, 1000);

            turretControl.SetTarget(target);

            WpfShootControlScript wpfShootControl = new WpfShootControlScript(this, cooldownBar, shootControl);

            return(new Script[] { turretControl, rocketSwitcher, wpfShootControl });
        }
示例#2
0
        private Script[] CreateTurretKeyboardScripts(ProgressBar cooldownBar,
                                                     OpenTK.Input.Key up, OpenTK.Input.Key down, OpenTK.Input.Key shoot,
                                                     OpenTK.Input.Key next, OpenTK.Input.Key previous)
        {
            TurretKeyboardControlScript turretControl = new TurretKeyboardControlScript(2);

            turretControl.SetKeyToTurnUp(up);
            turretControl.SetKeyToTurnDown(down);
            ShootKeyboardControlScript shootControl = new ShootKeyboardControlScript(this);

            shootControl.SetKey(shoot);
            KeyboardRocketSwitcherScript rocketSwitcher = new KeyboardRocketSwitcherScript();

            rocketSwitcher.SetKeyToSelectNext(next);
            rocketSwitcher.SetKeyToSelectPrevious(previous);

            WpfShootControlScript wpfShootControl = new WpfShootControlScript(this, cooldownBar, shootControl);

            return(new Script[] { turretControl, rocketSwitcher, wpfShootControl });
        }