WIP Parchment, make an editor script and set value on Warcraft scene
This commit is contained in:
@@ -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
|
||||
@@ -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,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
|
||||
|
||||
Reference in New Issue
Block a user