private static void AddButtonGroup(AtmosManager atmosManager) { EditorGUILayout.BeginHorizontal(); GUI.enabled = Application.isPlaying && atmosManager.Mode != AtmosMode.Manual; if (!atmosManager.Running) { if (GUILayout.Button("Start")) { atmosManager.StartSimulation(); } } else if (GUILayout.Button("Stop")) { atmosManager.StopSimulation(); } GUI.enabled = Application.isPlaying && !atmosManager.Running; if (GUILayout.Button("Step")) { AtmosThread.RunStep(); } GUI.enabled = true; EditorGUILayout.EndHorizontal(); }
private void MonitorSystem() { if (!livingHealthBehaviour.IsDead) { Vector3Int position = objectBehaviour.AssumedWorldPositionServer(); MetaDataNode node = MatrixManager.GetMetaDataAt(position); if (!IsEVACompatible()) { temperature = node.GasMix.Temperature; pressure = node.GasMix.Pressure; CheckPressureDamage(); } else { pressure = 101.325f; temperature = 293.15f; } if (livingHealthBehaviour.OverallHealth >= HealthThreshold.SoftCrit) { if (Breathe(node)) { AtmosManager.Update(node); } } else { bloodSystem.OxygenDamage += 1; } } }
private void MonitorSystem() { if (!livingHealthBehaviour.IsDead) { Vector3Int position = objectBehaviour.AssumedLocation().RoundToInt(); MetaDataNode node = MatrixManager.GetMetaDataAt(position); PressureStatus = CheckPressureStatus(node.GasMix.Pressure); TempStatus = CheckTempStatus(node.GasMix.Temperature); if (!IsEVACompatible()) { CheckPressureDamage(node.GasMix.Pressure); } if (livingHealthBehaviour.OverallHealth >= HealthThreshold.SoftCrit) { if (Breathe(node)) { AtmosManager.Update(node); } } else { bloodSystem.OxygenDamage += 1; } } }
public override void OnInspectorGUI() { AtmosManager atmosManager = (AtmosManager)target; GUIContent speedContent = new GUIContent("Speed", "frequency of Atmos simulation updates (Millieseconds between each update)"); GUIContent SubOperations = new GUIContent("SubOperations", "The number of operations done in each update ( meant for sub millisecond adjustment )"); GUIContent numThreadsContent = new GUIContent("Threads", "not currently implemented, thread count is always locked at one regardless of this setting"); atmosManager.Mode = (AtmosMode)EditorGUILayout.EnumPopup("Mode", atmosManager.Mode); atmosManager.Speed = EditorGUILayout.Slider(speedContent, atmosManager.Speed, 0, 5000); GUI.enabled = atmosManager.Mode == AtmosMode.Threaded; atmosManager.NumberThreads = EditorGUILayout.IntSlider(numThreadsContent, atmosManager.NumberThreads, 1, 1); GUI.enabled = true; AddButtonGroup(atmosManager); EditorGUILayout.LabelField("Update List Count", AtmosThread.GetUpdateListCount().ToString()); EditorUtility.SetDirty(atmosManager); }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } }
public override void OnInspectorGUI() { AtmosManager atmosManager = (AtmosManager)target; atmosManager.Speed = EditorGUILayout.Slider("Speed", atmosManager.Speed, 0.01f, 1f); atmosManager.NumberThreads = EditorGUILayout.IntSlider("Threads", atmosManager.NumberThreads, 1, 1); EditorGUILayout.LabelField("Update List Count", AtmosThread.GetUpdateListCount().ToString()); EditorUtility.SetDirty(atmosManager); }
public override void ImplantPeriodicUpdate() { base.ImplantPeriodicUpdate(); Vector3Int position = healthMaster.ObjectBehaviour.AssumedWorldPositionServer(); MetaDataNode node = MatrixManager.GetMetaDataAt(position); if (TryBreathing(node, TotalModified)) { AtmosManager.Update(node); } }
private void MonitorSystem() { if (!livingHealthBehaviour.IsDead) { Vector3Int position = transform.position.RoundToInt(); MetaDataNode node = MatrixManager.GetMetaDataAt(position); if (!IsEVACompatible()) { CheckPressureDamage(node.GasMix.Pressure); } if (Breathe(node)) { AtmosManager.Update(node); } } }
public override void ImplantPeriodicUpdate() { base.ImplantPeriodicUpdate(); Vector3Int position = RelatedPart.HealthMaster.ObjectBehaviour.AssumedWorldPositionServer(); MetaDataNode node = MatrixManager.GetMetaDataAt(position); var TotalModified = 1f; foreach (var Modifier in RelatedPart.AppliedModifiers) { var toMultiply = 1f; if (Modifier == RelatedPart.DamageModifier) { toMultiply = Mathf.Max(0f, Mathf.Max(RelatedPart.MaxHealth - RelatedPart.TotalDamageWithoutOxyCloneRadStam, 0) / RelatedPart.MaxHealth); } else if (Modifier == RelatedPart.HungerModifier) { continue; } else { toMultiply = Mathf.Max(0f, Modifier.Multiplier); } TotalModified *= toMultiply; } if (TryBreathing(node, TotalModified)) { AtmosManager.Update(node); } if (RelatedPart.IsBleedingInternally) { InternalDamageLogic(); } }