コード例 #1
0
 public void AddLink(LinkedMap source, WarpController sourceWarp, LinkedMap destination, WarpController destinationWarp, bool reciprocal)
 {
     source.mapLinks.Add(new WarpLink(sourceWarp, destinationWarp, destination));
     if (reciprocal == true)
     {
         destination.mapLinks.Add(new WarpLink(destinationWarp, sourceWarp, destination));
     }
 }
コード例 #2
0
        /*
         *
         */
        public MainWindow()
        {
            InitializeComponent();

            // start of custom code
            WriteToLog.write("---- System Start ----", string.Empty, true);
            debug = Config.ReadElement("Debug", "False", true).Equals("true", StringComparison.OrdinalIgnoreCase);

            // initialize the sub classes
            GameBoard     = new GameBoard(this);
            GameMap       = new GameMap(this);
            SRS           = new SRSController(this);
            LRS           = new LRSController(this);
            Warp          = new WarpController(this);
            Torpedoes     = new TorpedoController(this);
            Phasers       = new PhaserController(this);
            Shields       = new ShieldController(this);
            Impulse       = new ImpulseController(this);
            GameObjects   = new GameObjects(this);
            DamageControl = new DamageControl(this);
            StarBases     = new StarBaseController(this);
            Probes        = new ProbeController(this);

            // set up a new board and start the timer
            NewGame(8);
            CreateTimer();

            WriteToLog.write("Debug = " + debug.ToString());
            WriteToLog.ClearOldLogs();

            // set up the hotkeys
            rcImpulse.InputGestures.Add(new KeyGesture(Key.I, ModifierKeys.Control));
            CommandBindings.Add(new CommandBinding(rcImpulse, ImpulseCommand));

            rcWarp.InputGestures.Add(new KeyGesture(Key.W, ModifierKeys.Control));
            CommandBindings.Add(new CommandBinding(rcWarp, WarpCommand));

            rcTorpedoes.InputGestures.Add(new KeyGesture(Key.T, ModifierKeys.Control));
            CommandBindings.Add(new CommandBinding(rcTorpedoes, TorpedoCommand));

            rcPhasers.InputGestures.Add(new KeyGesture(Key.P, ModifierKeys.Control));
            CommandBindings.Add(new CommandBinding(rcPhasers, PhaserCommand));

            rcShields.InputGestures.Add(new KeyGesture(Key.S, ModifierKeys.Control));
            CommandBindings.Add(new CommandBinding(rcShields, ShieldCommand));
        }
コード例 #3
0
    private void OnTriggerStay(Collider other)
    {
        WarpController warpController = other.GetComponent <WarpController>();

        if (warpController != null)
        {
            bool canEnter = warpController.PlayerWarpSpeed == Vector3.zero ||
                            (m_CurrentSpeed != Vector3.zero && Mathf.Sign(m_CurrentSpeed.x) != Mathf.Sign(warpController.PlayerWarpSpeed.x));
            if (canEnter)
            {
                warpController.Exit.PlayerWarpSpeed = m_CurrentSpeed;
                Vector3 deltaEnter = warpController.transform.position - transform.position;
                Vector3 warpTo     = warpController.Exit.transform.position + deltaEnter * 0.5f;
                transform.position = warpTo;
            }
        }
    }
コード例 #4
0
 public WarpLink(WarpController source, WarpController destination, LinkedMap linkedMap)
 {
     sourceWarp      = source;
     this.linkedMap  = linkedMap;
     destinationWarp = destination;
 }
コード例 #5
0
 // Start is called before the first frame update
 void Awake()
 {
     warp = FindObjectOfType <WarpController>();
 }
コード例 #6
0
 // Start is called before the first frame update
 void Start()
 {
     warp = FindObjectOfType <WarpController>();
 }