WIP Parchment, make an editor script and set value on Warcraft scene

This commit is contained in:
stilobique-i7
2021-05-25 16:44:55 +02:00
committed by VAILLANT Jeremy
parent f330135fa8
commit 813e27c828
6 changed files with 17 additions and 22 deletions
-20
View File
@@ -1,20 +0,0 @@
extends Spatial
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
export var paper = false
func _init():
$sm_paperparchment_lod0.set_visible(paper)
print("[Parchment] Set is visibility > " + paper)
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
+15
View File
@@ -0,0 +1,15 @@
tool
extends Spatial
export(bool) var paper = false setget activatePaper
func activatePaper(showPaper):
if Engine.editor_hint:
paper = showPaper
print("[Parchment] Editor value " +String(showPaper))
$sm_paperparchment_lod0.set_visible(paper)
func _ready():
print("[Parchment] Paper bool " +String(paper))
$sm_paperparchment_lod0.set_visible(paper)
+1 -2
View File
@@ -1,12 +1,11 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://assets/props/parchment/sm_wood_parchment_lod1.mesh" type="ArrayMesh" id=1]
[ext_resource path="res://assets/props/parchment/gd_parchment.gd" type="Script" id=2]
[ext_resource path="res://assets/props/parchment/parchment.gd" type="Script" id=2]
[ext_resource path="res://assets/props/parchment/sm_paperparchment_lod0.mesh" type="ArrayMesh" id=3]
[node name="sm_parchment" type="Spatial"]
script = ExtResource( 2 )
paper = true
[node name="sm_wood_parchment_lod1" type="MeshInstance" parent="."]
use_in_baked_light = true
Binary file not shown.
Binary file not shown.
+1
View File
@@ -521,6 +521,7 @@ shape = SubResource( 7 )
[node name="dagger" type="MeshInstance" parent="Hidden Objects Items"]
transform = Transform( -0.625025, -0.777847, 0.0655765, 0, 0.0840072, 0.996466, -0.780606, 0.622816, -0.0525065, 0.69073, -0.117415, 0.830941 )
use_in_baked_light = true
generate_lightmap = false
mesh = ExtResource( 14 )
material/0 = ExtResource( 19 )