【问题标题】:Passing array as hint in string export?Passing array as hint in string export?
【发布时间】:2022-12-02 13:41:33
【问题描述】:

I\'m trying to pass an array as a hint in string export, something like this:

extends Node


var things_list=[\"thing_1\", \"thing_2\", \"thing_3\"]
export(String,*things_list) var current_thing=things_list[0]

why am I doing this?

I want to reuse the things_list & to do so I have to tediously write all the same values twice,
once in this list itself & once in export like this:

extends Node


var things_list=[\"thing_1\", \"thing_2\", \"thing_3\"]
export(String,\"thing_1\", \"thing_2\", \"thing_3\") var current_thing=things_list[0]

this becomes really annoying with longer lists,
So is there anything like ...array in js
or something like *args in python? (as shown in the first example)

or are the values somehow stored in the export variable itself?
maybe like current_thing.export_hints[1] #thing_2

    标签: godot gdscript


    【解决方案1】:
    猜你喜欢
    • 2022-12-01
    • 2022-12-02
    • 2022-12-02
    • 2022-12-02
    • 2021-04-10
    • 2022-12-02
    • 2020-03-23
    • 2022-08-07
    • 2017-12-04
    相关资源
    最近更新 更多