astek should be 'playable', kinda...
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aadf824e76564404c8d43d99803c60a1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -25,9 +25,9 @@ namespace RebootReality.jelycho.Main {
|
||||
s_Logger.Info($"Player {clientID} became ready");
|
||||
|
||||
if (RR.IsServer()) {
|
||||
PlayerActor actor = (PlayerActor) RR.SpawnActor(m_PlayerActorPrefab,
|
||||
Vector3.zero,
|
||||
Quaternion.identity);
|
||||
var actor = (PlayerActor) RR.SpawnActor(m_PlayerActorPrefab,
|
||||
Vector3.zero,
|
||||
Quaternion.identity);
|
||||
RR.PossessActor(clientID, actor.ActorID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using RebootKit.Engine.Main;
|
||||
using RebootKit.Engine.Foundation;
|
||||
using RebootKit.Engine.Main;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
@@ -14,6 +15,9 @@ namespace RebootReality.jelycho.MainMenu {
|
||||
|
||||
[SerializeField] UIDocument m_Document;
|
||||
|
||||
[ConfigVar("debug.startmap", "rr_astek")]
|
||||
static ConfigVar s_MapToHost;
|
||||
|
||||
void OnEnable() {
|
||||
VisualElement root = m_Document.rootVisualElement;
|
||||
|
||||
@@ -24,7 +28,9 @@ namespace RebootReality.jelycho.MainMenu {
|
||||
|
||||
hostButton.RegisterCallback<ClickEvent>(e => {
|
||||
RR.StartHost();
|
||||
RR.SetServerWorld("dev");
|
||||
|
||||
string worldID = s_MapToHost.StringValue;
|
||||
RR.SetServerWorld(worldID);
|
||||
});
|
||||
joinLocalhostButton.RegisterCallback<ClickEvent>(e => {
|
||||
RR.Connect();
|
||||
|
||||
@@ -852,8 +852,8 @@ namespace RebootReality.jelycho.Player {
|
||||
|
||||
float newYaw = Mathf.MoveTowardsAngle(m_Locomotion.YawRotation,
|
||||
m_Camera.Yaw,
|
||||
45.0f);
|
||||
s_Logger.Info($"YAW: {newYaw}");
|
||||
m_CharacterTurnVelocity);
|
||||
// s_Logger.Info($"YAW: {newYaw}");
|
||||
m_Locomotion.YawRotation = newYaw;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,39 +56,35 @@ namespace RebootReality.jelycho.Player {
|
||||
return;
|
||||
}
|
||||
|
||||
// if (IsOwner) {
|
||||
m_Actor.SetupAsOwner();
|
||||
m_Actor.SetupAsOwner();
|
||||
|
||||
m_OwnerActorDisposableBag.Dispose();
|
||||
m_OwnerActorDisposableBag = new DisposableBag();
|
||||
m_OwnerActorDisposableBag.Dispose();
|
||||
m_OwnerActorDisposableBag = new DisposableBag();
|
||||
|
||||
m_Actor.TargetInteractable.Subscribe(interactable => {
|
||||
m_Interactable?.SetHighlight(false);
|
||||
m_Actor.TargetInteractable.Subscribe(interactable => {
|
||||
m_Interactable?.SetHighlight(false);
|
||||
|
||||
if (m_TargetInteractableLabelDisposable != null) {
|
||||
m_TargetInteractableLabelDisposable.Dispose();
|
||||
m_TargetInteractableLabelDisposable = null;
|
||||
}
|
||||
if (m_TargetInteractableLabelDisposable != null) {
|
||||
m_TargetInteractableLabelDisposable.Dispose();
|
||||
m_TargetInteractableLabelDisposable = null;
|
||||
}
|
||||
|
||||
m_Interactable = interactable;
|
||||
m_Interactable?.SetHighlight(true);
|
||||
m_Interactable = interactable;
|
||||
m_Interactable?.SetHighlight(true);
|
||||
|
||||
if (interactable is Actor interactableActor) {
|
||||
m_TargetInteractableLabelDisposable =
|
||||
m_HUD.ObjectsLabels.CreateLabel(interactableActor.transform,
|
||||
interactableActor.ActorName);
|
||||
}
|
||||
})
|
||||
.AddTo(ref m_OwnerActorDisposableBag);
|
||||
if (interactable is Actor interactableActor) {
|
||||
m_TargetInteractableLabelDisposable =
|
||||
m_HUD.ObjectsLabels.CreateLabel(interactableActor.transform,
|
||||
interactableActor.ActorName);
|
||||
}
|
||||
})
|
||||
.AddTo(ref m_OwnerActorDisposableBag);
|
||||
|
||||
m_HUD.SetPlayerActor(m_Actor);
|
||||
// }
|
||||
m_HUD.SetPlayerActor(m_Actor);
|
||||
|
||||
// if (IsServer) {
|
||||
// if (RR.World.Context is WorldContext worldContext) {
|
||||
// m_Actor.WarpTo(worldContext.PlayerSpawnPoint.position);
|
||||
// }
|
||||
// }
|
||||
if (RR.World.Context is WorldContext worldContext) {
|
||||
m_Actor.WarpTo(worldContext.PlayerSpawnPoint.position);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnUnpossessActor(Actor actor) {
|
||||
@@ -123,7 +119,7 @@ namespace RebootReality.jelycho.Player {
|
||||
if (m_Config.kickActionReference.action.WasReleasedThisFrame()) {
|
||||
m_Actor.Kick();
|
||||
}
|
||||
|
||||
|
||||
if (m_Config.primaryActionReference.action.WasPressedThisFrame()) {
|
||||
m_Actor.BeginPrimaryAction();
|
||||
}
|
||||
|
||||
@@ -63,6 +63,13 @@ namespace RebootReality.jelycho.Player {
|
||||
return transform.InverseTransformDirection(m_LastVelocity);
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 Velocity {
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get {
|
||||
return m_LastVelocity;
|
||||
}
|
||||
}
|
||||
|
||||
void Awake() {
|
||||
m_Motor.CharacterController = this;
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
using RebootKit.Engine.Services.Simulation;
|
||||
using RebootReality.jelycho.Main;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
namespace RebootReality.jelycho {
|
||||
[AddComponentMenu(GameConsts.k_AddComponentMenu + "Zombie Actor")]
|
||||
public class ZombieActor : Actor {
|
||||
[SerializeField] NavMeshAgent m_NavMeshAgent;
|
||||
[SerializeField] Animator m_Animator;
|
||||
|
||||
void OnEnable() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: efc25d13716540beb6fc3f803e94385e
|
||||
timeCreated: 1743790224
|
||||
Reference in New Issue
Block a user