Ported to godot 4.6
This commit is contained in:
parent
004ad764d6
commit
cc7c6af33f
3 changed files with 9 additions and 6 deletions
|
|
@ -8,11 +8,15 @@
|
|||
|
||||
config_version=5
|
||||
|
||||
[animation]
|
||||
|
||||
compatibility/default_parent_skeleton_in_mesh_instance_3d=true
|
||||
|
||||
[application]
|
||||
|
||||
config/name="lab-electrolyte"
|
||||
run/main_scene="uid://c7r4rhgj3ucao"
|
||||
config/features=PackedStringArray("4.5", "Mobile")
|
||||
config/features=PackedStringArray("4.6", "Mobile")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[autoload]
|
||||
|
|
|
|||
|
|
@ -31,10 +31,11 @@ size_flags_horizontal = 3
|
|||
size_flags_vertical = 0
|
||||
size_flags_stretch_ratio = 4.0
|
||||
deselect_enabled = true
|
||||
tab_count = 3
|
||||
tab_count = 4
|
||||
tab_0/title = "Ход работы"
|
||||
tab_1/title = "Вопросы для самопроверки"
|
||||
tab_2/title = "Отчёт"
|
||||
tab_3/title = "Очистить"
|
||||
|
||||
[node name="InspectorPanel" type="PanelContainer" parent="HSplitContainer"]
|
||||
layout_mode = 2
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ func update_material(substances: Array[RuntimeSubstanceData]) -> void:
|
|||
for sub in substances:
|
||||
total_weight += sub.amount
|
||||
|
||||
var alpha: float = 0
|
||||
var pH: float = 0
|
||||
var color: Color = Color(0,0,0,0)
|
||||
|
||||
|
|
@ -31,15 +30,14 @@ func update_material(substances: Array[RuntimeSubstanceData]) -> void:
|
|||
for sub: RuntimeSubstanceData in substances:
|
||||
var weight: float = sub.amount/total_weight
|
||||
if display_type == DisplayType.Fluid:
|
||||
alpha += sub.substance.liquid_transparency * weight
|
||||
pass
|
||||
if sub.substance.pHColor != null:
|
||||
color += sub.substance.pHColor.sample(pH/14.0) * weight
|
||||
else:
|
||||
color += sub.substance.color * weight
|
||||
|
||||
if display_type == DisplayType.Fluid:
|
||||
alpha /= len(substances)
|
||||
color.a = alpha
|
||||
pass
|
||||
|
||||
|
||||
mat.albedo_color = color
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue