This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends MeshInstance | |
export var lod_distance = 15 | |
export(Array,Mesh) var meshes | |
func _notification(what): | |
if what == NOTIFICATION_VISIBILITY_CHANGED: | |
set_process(is_visible_in_tree()) | |
func _process(delta): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends MultiMeshInstance | |
export(Shape) var shape = null | |
var _shape_rid = null | |
var _bodies = [] | |
#Done in _enter_tree() and not in _init() because its when the exported shape and world space is set | |
func _enter_tree(): | |
_shape_rid = RID(shape) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onready var timer = Timer.new | |
var wait_time = 30 #The video duration | |
func _ready(): | |
add_child(timer) | |
timer.set_wait_time(wait_time) | |
timer.connect("timeout",self,"video_ended") | |
timer.start() | |
func video_ended(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node | |
func _ready(): | |
var img = ImageTexture.new() | |
img.load("res://image.png") | |
var img_data = img.get_data() | |
var raw_data = img_data.get_data() | |
save(raw_data) | |
func save(content): |