mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
add ship to enter/leave
This commit is contained in:
parent
cf23dabbd9
commit
1fd0079018
@ -24,6 +24,8 @@
|
||||
public static string ExitRoastingMode = "ExitRoastingMode";
|
||||
public static string EnterFlightConsole = "EnterFlightConsole";
|
||||
public static string ExitFlightConsole = "ExitFlightConsole";
|
||||
public static string EnterShip = "EnterShip";
|
||||
public static string ExitShip = "ExitShip";
|
||||
|
||||
// Custom event names -- change if you want! These can be anything, as long as both
|
||||
// sides of the GlobalMessenger (fireevent and addlistener) reference the same thing.
|
||||
|
@ -9,6 +9,8 @@
|
||||
EnterPlatform = 4,
|
||||
ExitPlatform = 5,
|
||||
EnterHeadZone = 6,
|
||||
ExitHeadZone = 7
|
||||
ExitHeadZone = 7,
|
||||
EnterShip = 8,
|
||||
ExitShip = 9
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,8 @@ namespace QSB.Player.Events
|
||||
GlobalMessenger<int>.AddListener(EventNames.QSBExitPlatform, (int id) => Handler(EnterLeaveType.ExitPlatform, id));
|
||||
GlobalMessenger<int>.AddListener(EventNames.QSBEnterHeadZone, (int id) => Handler(EnterLeaveType.EnterHeadZone, id));
|
||||
GlobalMessenger<int>.AddListener(EventNames.QSBExitHeadZone, (int id) => Handler(EnterLeaveType.ExitHeadZone, id));
|
||||
GlobalMessenger.AddListener(EventNames.EnterShip, () => Handler(EnterLeaveType.EnterShip));
|
||||
GlobalMessenger.AddListener(EventNames.ExitShip, () => Handler(EnterLeaveType.ExitShip));
|
||||
}
|
||||
|
||||
public override void CloseListener()
|
||||
|
@ -1,9 +1,11 @@
|
||||
using OWML.Common;
|
||||
using QSB.Player;
|
||||
using QSB.ShipSync.TransformSync;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using QuantumUNET;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
@ -33,6 +35,8 @@ namespace QSB.ShipSync
|
||||
}
|
||||
}
|
||||
|
||||
private List<PlayerInfo> _playersInShip = new List<PlayerInfo>();
|
||||
|
||||
private uint _currentFlyer = uint.MaxValue;
|
||||
|
||||
public void Start()
|
||||
@ -82,6 +86,16 @@ namespace QSB.ShipSync
|
||||
PrintAll(shipHulls);
|
||||
}
|
||||
|
||||
public void AddPlayerToShip(PlayerInfo player)
|
||||
{
|
||||
_playersInShip.Add(player);
|
||||
}
|
||||
|
||||
public void RemovePlayerFromShip(PlayerInfo player)
|
||||
{
|
||||
_playersInShip.Remove(player);
|
||||
}
|
||||
|
||||
private void PrintAll(Array array)
|
||||
{
|
||||
foreach (var item in array)
|
||||
|
Loading…
Reference in New Issue
Block a user