Fixes issue where you can't change ingredient types in-editor.
This commit is contained in:
NoelStephensUnity 2024-06-05 13:12:36 -05:00
Родитель cf39fb1500
Коммит 565a7f6c83
5 изменённых файлов: 22 добавлений и 3 удалений

Просмотреть файл

@ -52,6 +52,10 @@ PrefabInstance:
propertyPath: GlobalObjectIdHash
value: 1010565204
objectReference: {fileID: 0}
- target: {fileID: 8268979759230423690, guid: a6b33b41508134c09957e076f4d53415, type: 3}
propertyPath: IngredientType
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8268979759230423690, guid: a6b33b41508134c09957e076f4d53415, type: 3}
propertyPath: currentIngredientType.m_InternalValue
value: 1

Просмотреть файл

@ -52,6 +52,10 @@ PrefabInstance:
propertyPath: GlobalObjectIdHash
value: 4112275378
objectReference: {fileID: 0}
- target: {fileID: 8268979759230423690, guid: a6b33b41508134c09957e076f4d53415, type: 3}
propertyPath: IngredientType
value: 2
objectReference: {fileID: 0}
- target: {fileID: 8268979759230423690, guid: a6b33b41508134c09957e076f4d53415, type: 3}
propertyPath: currentIngredientType.m_InternalValue
value: 2

Просмотреть файл

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.21890238, g: 0.16790517, b: 0.6703396, a: 1}
m_IndirectSpecularColor: {r: 0.21890283, g: 0.16790575, b: 0.67034173, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@ -1741,6 +1741,10 @@ PrefabInstance:
propertyPath: GlobalObjectIdHash
value: 2634250759
objectReference: {fileID: 0}
- target: {fileID: 2695509083640791865, guid: d793abe7ff9aa094eb534e73a82fdab5, type: 3}
propertyPath: IngredientType
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2695509083640791865, guid: d793abe7ff9aa094eb534e73a82fdab5, type: 3}
propertyPath: m_ScoreTracker
value:

Просмотреть файл

@ -16,7 +16,10 @@ public enum IngredientType
public class ServerObjectWithIngredientType : NetworkBehaviour
{
public NetworkVariable<IngredientType> currentIngredientType;
[HideInInspector]
public NetworkVariable<IngredientType> currentIngredientType = new NetworkVariable<IngredientType>();
public IngredientType IngredientType;
public event Action ingredientDespawned;
@ -28,6 +31,10 @@ public class ServerObjectWithIngredientType : NetworkBehaviour
enabled = false;
return;
}
else
{
currentIngredientType.Value = IngredientType;
}
}
public override void OnNetworkDespawn()

Просмотреть файл

@ -56,7 +56,7 @@ public class ServerIngredientSpawner : NetworkBehaviour
position: spawnPoint.transform.position + new Vector3(UnityEngine.Random.Range(-0.25f, 0.25f), 0, UnityEngine.Random.Range(-0.25f, 0.25f)),
rotation: spawnPoint.transform.rotation);
var ingredient = newIngredientObject.GetComponent<ServerIngredient>();
ingredient.currentIngredientType.Value = (IngredientType)m_RandomGenerator.Next((int)IngredientType.MAX);
ingredient.IngredientType = (IngredientType)m_RandomGenerator.Next((int)IngredientType.MAX);
}
m_SpawnWaves++;