Double fix
- Ability projectiles now properly visually disables on remotes - network job data class created to generate json string from jobdata, workaround for scriptable object serialization
This commit is contained in:
parent
8ce897c3aa
commit
494330fa1f
@ -210,31 +210,31 @@ AnimatorController:
|
|||||||
m_DefaultFloat: 0
|
m_DefaultFloat: 0
|
||||||
m_DefaultInt: 0
|
m_DefaultInt: 0
|
||||||
m_DefaultBool: 0
|
m_DefaultBool: 0
|
||||||
m_Controller: {fileID: 9100000}
|
m_Controller: {fileID: 0}
|
||||||
- m_Name: throw
|
- m_Name: throw
|
||||||
m_Type: 9
|
m_Type: 9
|
||||||
m_DefaultFloat: 0
|
m_DefaultFloat: 0
|
||||||
m_DefaultInt: 0
|
m_DefaultInt: 0
|
||||||
m_DefaultBool: 0
|
m_DefaultBool: 0
|
||||||
m_Controller: {fileID: 9100000}
|
m_Controller: {fileID: 0}
|
||||||
- m_Name: throwingTime
|
- m_Name: throwingTime
|
||||||
m_Type: 1
|
m_Type: 1
|
||||||
m_DefaultFloat: 0
|
m_DefaultFloat: 0
|
||||||
m_DefaultInt: 0
|
m_DefaultInt: 0
|
||||||
m_DefaultBool: 0
|
m_DefaultBool: 0
|
||||||
m_Controller: {fileID: 9100000}
|
m_Controller: {fileID: 0}
|
||||||
- m_Name: castingTime
|
- m_Name: castingTime
|
||||||
m_Type: 1
|
m_Type: 1
|
||||||
m_DefaultFloat: 0
|
m_DefaultFloat: 0
|
||||||
m_DefaultInt: 0
|
m_DefaultInt: 0
|
||||||
m_DefaultBool: 0
|
m_DefaultBool: 0
|
||||||
m_Controller: {fileID: 9100000}
|
m_Controller: {fileID: 0}
|
||||||
- m_Name: cast
|
- m_Name: cast
|
||||||
m_Type: 9
|
m_Type: 9
|
||||||
m_DefaultFloat: 0
|
m_DefaultFloat: 0
|
||||||
m_DefaultInt: 0
|
m_DefaultInt: 0
|
||||||
m_DefaultBool: 0
|
m_DefaultBool: 0
|
||||||
m_Controller: {fileID: 9100000}
|
m_Controller: {fileID: 0}
|
||||||
m_AnimatorLayers:
|
m_AnimatorLayers:
|
||||||
- serializedVersion: 5
|
- serializedVersion: 5
|
||||||
m_Name: Base Layer
|
m_Name: Base Layer
|
||||||
|
@ -45,6 +45,8 @@ MonoBehaviour:
|
|||||||
- RPC_OnLevelUp
|
- RPC_OnLevelUp
|
||||||
- RPC_OnDeath
|
- RPC_OnDeath
|
||||||
- RPC_RemoteInit
|
- RPC_RemoteInit
|
||||||
|
- RPC_DisableVisuals
|
||||||
|
- RPC_SetTriggerBasedOnAbility
|
||||||
DisableAutoOpenWizard: 1
|
DisableAutoOpenWizard: 1
|
||||||
ShowSettings: 0
|
ShowSettings: 0
|
||||||
DevRegionSetOnce: 1
|
DevRegionSetOnce: 1
|
||||||
|
@ -84,8 +84,8 @@ GameObject:
|
|||||||
- component: {fileID: 686220006257547049}
|
- component: {fileID: 686220006257547049}
|
||||||
- component: {fileID: 1935554058595948164}
|
- component: {fileID: 1935554058595948164}
|
||||||
- component: {fileID: 1164818847862470281}
|
- component: {fileID: 1164818847862470281}
|
||||||
- component: {fileID: 583639914168640231}
|
|
||||||
- component: {fileID: 7751829926650204974}
|
- component: {fileID: 7751829926650204974}
|
||||||
|
- component: {fileID: 583639914168640231}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Barbarian
|
m_Name: Barbarian
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -150,6 +150,18 @@ Animator:
|
|||||||
m_AllowConstantClipSamplingOptimization: 1
|
m_AllowConstantClipSamplingOptimization: 1
|
||||||
m_KeepAnimatorStateOnDisable: 0
|
m_KeepAnimatorStateOnDisable: 0
|
||||||
m_WriteDefaultValuesOnDisable: 0
|
m_WriteDefaultValuesOnDisable: 0
|
||||||
|
--- !u!114 &7751829926650204974
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 202136249774837139}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 75ba268000bc14f4287a8a1f8c3dabd6, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!114 &583639914168640231
|
--- !u!114 &583639914168640231
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -168,23 +180,23 @@ MonoBehaviour:
|
|||||||
- Type: 1
|
- Type: 1
|
||||||
SynchronizeType: 1
|
SynchronizeType: 1
|
||||||
Name: movementSpeed
|
Name: movementSpeed
|
||||||
|
- Type: 9
|
||||||
|
SynchronizeType: 0
|
||||||
|
Name: throw
|
||||||
|
- Type: 1
|
||||||
|
SynchronizeType: 1
|
||||||
|
Name: throwingTime
|
||||||
|
- Type: 1
|
||||||
|
SynchronizeType: 1
|
||||||
|
Name: castingTime
|
||||||
|
- Type: 9
|
||||||
|
SynchronizeType: 0
|
||||||
|
Name: cast
|
||||||
m_SynchronizeLayers:
|
m_SynchronizeLayers:
|
||||||
- SynchronizeType: 1
|
- SynchronizeType: 1
|
||||||
LayerIndex: 0
|
LayerIndex: 0
|
||||||
- SynchronizeType: 1
|
- SynchronizeType: 1
|
||||||
LayerIndex: 1
|
LayerIndex: 1
|
||||||
--- !u!114 &7751829926650204974
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 202136249774837139}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 75ba268000bc14f4287a8a1f8c3dabd6, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!1 &229964173686735936
|
--- !u!1 &229964173686735936
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -527,8 +527,8 @@ GameObject:
|
|||||||
- component: {fileID: 2119839822041585648}
|
- component: {fileID: 2119839822041585648}
|
||||||
- component: {fileID: 1936994702313746464}
|
- component: {fileID: 1936994702313746464}
|
||||||
- component: {fileID: 1936994702313746463}
|
- component: {fileID: 1936994702313746463}
|
||||||
- component: {fileID: 1936994702313746462}
|
|
||||||
- component: {fileID: 1936994702313746461}
|
- component: {fileID: 1936994702313746461}
|
||||||
|
- component: {fileID: 1936994702313746462}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Knight
|
m_Name: Knight
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -593,6 +593,18 @@ Animator:
|
|||||||
m_AllowConstantClipSamplingOptimization: 1
|
m_AllowConstantClipSamplingOptimization: 1
|
||||||
m_KeepAnimatorStateOnDisable: 0
|
m_KeepAnimatorStateOnDisable: 0
|
||||||
m_WriteDefaultValuesOnDisable: 0
|
m_WriteDefaultValuesOnDisable: 0
|
||||||
|
--- !u!114 &1936994702313746461
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1594555445357595978}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 75ba268000bc14f4287a8a1f8c3dabd6, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!114 &1936994702313746462
|
--- !u!114 &1936994702313746462
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -611,23 +623,23 @@ MonoBehaviour:
|
|||||||
- Type: 1
|
- Type: 1
|
||||||
SynchronizeType: 1
|
SynchronizeType: 1
|
||||||
Name: movementSpeed
|
Name: movementSpeed
|
||||||
|
- Type: 9
|
||||||
|
SynchronizeType: 0
|
||||||
|
Name: throw
|
||||||
|
- Type: 1
|
||||||
|
SynchronizeType: 1
|
||||||
|
Name: throwingTime
|
||||||
|
- Type: 1
|
||||||
|
SynchronizeType: 1
|
||||||
|
Name: castingTime
|
||||||
|
- Type: 9
|
||||||
|
SynchronizeType: 0
|
||||||
|
Name: cast
|
||||||
m_SynchronizeLayers:
|
m_SynchronizeLayers:
|
||||||
- SynchronizeType: 1
|
- SynchronizeType: 1
|
||||||
LayerIndex: 0
|
LayerIndex: 0
|
||||||
- SynchronizeType: 1
|
- SynchronizeType: 1
|
||||||
LayerIndex: 1
|
LayerIndex: 1
|
||||||
--- !u!114 &1936994702313746461
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1594555445357595978}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 75ba268000bc14f4287a8a1f8c3dabd6, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!1 &1604759570645128252
|
--- !u!1 &1604759570645128252
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -1529,6 +1529,18 @@ MonoBehaviour:
|
|||||||
- Type: 1
|
- Type: 1
|
||||||
SynchronizeType: 1
|
SynchronizeType: 1
|
||||||
Name: movementSpeed
|
Name: movementSpeed
|
||||||
|
- Type: 9
|
||||||
|
SynchronizeType: 0
|
||||||
|
Name: throw
|
||||||
|
- Type: 1
|
||||||
|
SynchronizeType: 1
|
||||||
|
Name: throwingTime
|
||||||
|
- Type: 1
|
||||||
|
SynchronizeType: 1
|
||||||
|
Name: castingTime
|
||||||
|
- Type: 9
|
||||||
|
SynchronizeType: 0
|
||||||
|
Name: cast
|
||||||
m_SynchronizeLayers:
|
m_SynchronizeLayers:
|
||||||
- SynchronizeType: 1
|
- SynchronizeType: 1
|
||||||
LayerIndex: 0
|
LayerIndex: 0
|
||||||
|
@ -38,7 +38,7 @@ RenderSettings:
|
|||||||
m_ReflectionIntensity: 1
|
m_ReflectionIntensity: 1
|
||||||
m_CustomReflection: {fileID: 0}
|
m_CustomReflection: {fileID: 0}
|
||||||
m_Sun: {fileID: 0}
|
m_Sun: {fileID: 0}
|
||||||
m_IndirectSpecularColor: {r: 0.06384377, g: 0.12772793, b: 0.13339028, a: 1}
|
m_IndirectSpecularColor: {r: 0.06321287, g: 0.12646174, b: 0.1320537, a: 1}
|
||||||
m_UseRadianceAmbientProbe: 0
|
m_UseRadianceAmbientProbe: 0
|
||||||
--- !u!157 &3
|
--- !u!157 &3
|
||||||
LightmapSettings:
|
LightmapSettings:
|
||||||
|
@ -60,6 +60,7 @@ public class CharacterAnimatorController : MonoBehaviour
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,6 +53,11 @@ public class NetworkedProjectile : MonoBehaviour
|
|||||||
{
|
{
|
||||||
ability = (ProjectileAbility)AbilityIndexer.Instance.Abilities[abilityIndex];
|
ability = (ProjectileAbility)AbilityIndexer.Instance.Abilities[abilityIndex];
|
||||||
}
|
}
|
||||||
|
[PunRPC]
|
||||||
|
private void RPC_DisableVisuals()
|
||||||
|
{
|
||||||
|
visuals.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
private void SpawnHitParticleVFX(Vector3 position)
|
private void SpawnHitParticleVFX(Vector3 position)
|
||||||
{
|
{
|
||||||
@ -122,6 +127,8 @@ public class NetworkedProjectile : MonoBehaviour
|
|||||||
{
|
{
|
||||||
visuals.SetActive(false);
|
visuals.SetActive(false);
|
||||||
|
|
||||||
|
photonView.RPC(nameof(RPC_DisableVisuals), RpcTarget.Others);
|
||||||
|
|
||||||
yield return new WaitForSeconds(1.5f);
|
yield return new WaitForSeconds(1.5f);
|
||||||
|
|
||||||
for (int i = hitSpawnedVFXs.Count - 1; i >= 0; i--)
|
for (int i = hitSpawnedVFXs.Count - 1; i >= 0; i--)
|
||||||
|
@ -24,3 +24,49 @@ public class JobData
|
|||||||
coinFinalReward = coinReward;
|
coinFinalReward = coinReward;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class NetworkJobData
|
||||||
|
{
|
||||||
|
public string title = "Skelly'nvasion Cleanup Crew";
|
||||||
|
public string description = @"Location: The Skellyard (Graveyard)
|
||||||
|
|
||||||
|
Mission Brief:
|
||||||
|
|
||||||
|
Attention, Rift Hunters!The Skellyard, once a serene resting place, has been overrun by a menacing horde of skeletons - the dreaded Skelly'nvasion! As a member of the Cleanup Crew, your mission is to venture into the heart of the Skellyard and purge it of these skeletal invaders.";
|
||||||
|
|
||||||
|
public bool showJobTitlePrefix = true;
|
||||||
|
|
||||||
|
//in-game zone name
|
||||||
|
public string zoneName;
|
||||||
|
//scene name
|
||||||
|
public string levelName;
|
||||||
|
|
||||||
|
public int coinFinalReward;
|
||||||
|
public float experienceFinalReward;
|
||||||
|
public float reputationFinalReward;
|
||||||
|
|
||||||
|
|
||||||
|
public NetworkJobData(string title, string description, bool showJobTitlePrefix, string zoneName, string levelName, int coinFinalReward, float experienceFinalReward, float reputationFinalReward)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
this.description = description;
|
||||||
|
this.showJobTitlePrefix = showJobTitlePrefix;
|
||||||
|
this.zoneName = zoneName;
|
||||||
|
this.levelName = levelName;
|
||||||
|
this.coinFinalReward = coinFinalReward;
|
||||||
|
this.experienceFinalReward = experienceFinalReward;
|
||||||
|
this.reputationFinalReward = reputationFinalReward;
|
||||||
|
}
|
||||||
|
public NetworkJobData(JobData jobData)
|
||||||
|
{
|
||||||
|
this.title = jobData.jobDescription.title;
|
||||||
|
this.description = jobData.jobDescription.description;
|
||||||
|
this.showJobTitlePrefix = jobData.jobDescription.showJobTitlePrefix;
|
||||||
|
this.zoneName = jobData.zoneData.zoneName;
|
||||||
|
this.levelName = jobData.zoneData.levelName;
|
||||||
|
this.coinFinalReward = jobData.coinFinalReward;
|
||||||
|
this.experienceFinalReward = jobData.experienceFinalReward;
|
||||||
|
this.reputationFinalReward = jobData.reputationFinalReward;
|
||||||
|
}
|
||||||
|
}
|
@ -10,7 +10,7 @@ public class JobDescription : ScriptableObject
|
|||||||
public string title = "Skelly'nvasion Cleanup Crew";
|
public string title = "Skelly'nvasion Cleanup Crew";
|
||||||
[Header("Description:")]
|
[Header("Description:")]
|
||||||
[TextArea(10,20)]
|
[TextArea(10,20)]
|
||||||
public string description = @"Location: The Skellyard (Graveyard)
|
public string description = @"Location: The Skellyard (Graveyard)
|
||||||
|
|
||||||
Mission Brief:
|
Mission Brief:
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ public class JobInfoPanel : MonoBehaviour, IOnEventCallback
|
|||||||
[SerializeField] private GameEventListener onJobsBoardReleased;
|
[SerializeField] private GameEventListener onJobsBoardReleased;
|
||||||
[SerializeField] private GameEventListener_Player onPlayerVoted;
|
[SerializeField] private GameEventListener_Player onPlayerVoted;
|
||||||
|
|
||||||
|
NetworkJobData networkJobData;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
onJobSelected.Response.AddListener((job) => SetupJobInfoPanel(job, true));
|
onJobSelected.Response.AddListener((job) => SetupJobInfoPanel(job, true));
|
||||||
@ -54,6 +56,22 @@ public class JobInfoPanel : MonoBehaviour, IOnEventCallback
|
|||||||
if (showPanel)
|
if (showPanel)
|
||||||
ToggleInfoPanel(true);
|
ToggleInfoPanel(true);
|
||||||
}
|
}
|
||||||
|
private void SetupJobInfoPanel(NetworkJobData jobData, bool showPanel)
|
||||||
|
{
|
||||||
|
if (jobData.showJobTitlePrefix)
|
||||||
|
title.text = $"Job Title: {jobData.title}";
|
||||||
|
else
|
||||||
|
title.text = $"{jobData.title}";
|
||||||
|
|
||||||
|
description.text = jobData.description;
|
||||||
|
|
||||||
|
coinReward.text = jobData.coinFinalReward.ToString();
|
||||||
|
experienceReward.text = jobData.experienceFinalReward.ToString();
|
||||||
|
reputationReward.text = jobData.reputationFinalReward.ToString();
|
||||||
|
|
||||||
|
if (showPanel)
|
||||||
|
ToggleInfoPanel(true);
|
||||||
|
}
|
||||||
|
|
||||||
public void ToggleInfoPanel(bool visible)
|
public void ToggleInfoPanel(bool visible)
|
||||||
{
|
{
|
||||||
@ -62,9 +80,13 @@ public class JobInfoPanel : MonoBehaviour, IOnEventCallback
|
|||||||
|
|
||||||
private void Send_Others_OnJobSelected(JobData jobData)
|
private void Send_Others_OnJobSelected(JobData jobData)
|
||||||
{
|
{
|
||||||
if (PhotonNetwork.CurrentRoom.PlayerCount <= 1) return;
|
//if (PhotonNetwork.CurrentRoom.PlayerCount <= 1) return;
|
||||||
|
|
||||||
|
networkJobData = new NetworkJobData(jobData);
|
||||||
|
|
||||||
|
string jsonJobData = JsonUtility.ToJson(networkJobData);
|
||||||
|
Debug.Log($"JobData: {jsonJobData}");
|
||||||
|
|
||||||
string jsonJobData = JsonUtility.ToJson(jobData);
|
|
||||||
RaiseEventOptions raiseEventOptions = new RaiseEventOptions { Receivers = ReceiverGroup.Others };
|
RaiseEventOptions raiseEventOptions = new RaiseEventOptions { Receivers = ReceiverGroup.Others };
|
||||||
PhotonNetwork.RaiseEvent(GameConstants.NetworkEventCodes.JobSelection, jsonJobData, raiseEventOptions, SendOptions.SendReliable);
|
PhotonNetwork.RaiseEvent(GameConstants.NetworkEventCodes.JobSelection, jsonJobData, raiseEventOptions, SendOptions.SendReliable);
|
||||||
}
|
}
|
||||||
@ -77,7 +99,7 @@ public class JobInfoPanel : MonoBehaviour, IOnEventCallback
|
|||||||
|
|
||||||
Debug.Log("Job selected: " + jsonJobData);
|
Debug.Log("Job selected: " + jsonJobData);
|
||||||
|
|
||||||
SetupJobInfoPanel(JsonUtility.FromJson<JobData>(jsonJobData), false);
|
SetupJobInfoPanel(JsonUtility.FromJson<NetworkJobData>(jsonJobData), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user