Pascal Serrarens de12c36220 First commit
2022-01-11 16:51:37 +01:00

52 lines
1.5 KiB
C#

using UnityEngine;
namespace Passer {
#if hNW_PHOTON && hPHOTON2
public partial class NetworkObject : INetworkObject {
#else
public partial class NetworkObject : MonoBehaviour, INetworkObject {
#endif
public static bool connected = true;
private void Awake() {
connected = true;
}
public static INetworkObject GetINetworkObject(FunctionCall functionCall) {
if (functionCall.targetGameObject == null)
return null;
INetworkObject networkObj = functionCall.targetGameObject.GetComponent<INetworkObject>();
return networkObj;
}
public static INetworkObject GetINetworkObject(GameObject targetGameObject) {
if (targetGameObject == null)
return null;
INetworkObject networkObj = targetGameObject.GetComponent<INetworkObject>();
return networkObj;
}
#if !hNW_PHOTON
public void RPC(FunctionCall function) { }
public void RPC(FunctionCall functionCall, bool value) { }
public void RPC(FunctionCall functionCall, float value) { }
public void RPC<T>(FunctionCall functionCall, T value) { }
#endif
}
public interface INetworkObject {
void RPC(FunctionCall functionCall);
//void RPC(FunctionCall functionCall, bool value);
//void RPC(FunctionCall functionCall, float value);
void RPC<T>(FunctionCall functionCall, T value);
}
}