From 2852b5740bf7cf0944ec6291d374216626d0b058 Mon Sep 17 00:00:00 2001 From: Jummit Date: Thu, 31 Oct 2019 18:33:54 +0100 Subject: [PATCH] use the add_custom_type to add the OrbitCamera --- addons/orbit_camera/orbit_camera.gd | 2 - addons/orbit_camera/orbit_camera_icon.svg | 71 +++++++++++++++++++ .../orbit_camera/orbit_camera_icon.svg.import | 34 +++++++++ addons/orbit_camera/plugin.cfg | 2 +- addons/orbit_camera/plugin.gd | 8 +++ 5 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 addons/orbit_camera/orbit_camera_icon.svg create mode 100644 addons/orbit_camera/orbit_camera_icon.svg.import create mode 100644 addons/orbit_camera/plugin.gd diff --git a/addons/orbit_camera/orbit_camera.gd b/addons/orbit_camera/orbit_camera.gd index 623da41..0894d4f 100644 --- a/addons/orbit_camera/orbit_camera.gd +++ b/addons/orbit_camera/orbit_camera.gd @@ -1,7 +1,5 @@ extends Camera -class_name OrbitCamera - # External var export var SCROLL_SPEED: float = 10 export var DEFAULT_DISTANCE: float = 20 diff --git a/addons/orbit_camera/orbit_camera_icon.svg b/addons/orbit_camera/orbit_camera_icon.svg new file mode 100644 index 0000000..e25492b --- /dev/null +++ b/addons/orbit_camera/orbit_camera_icon.svg @@ -0,0 +1,71 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/addons/orbit_camera/orbit_camera_icon.svg.import b/addons/orbit_camera/orbit_camera_icon.svg.import new file mode 100644 index 0000000..0c1dabc --- /dev/null +++ b/addons/orbit_camera/orbit_camera_icon.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/orbit_camera_icon.svg-ec846f788d42e90042ed8dcf2b3e17b0.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/orbit_camera/orbit_camera_icon.svg" +dest_files=[ "res://.import/orbit_camera_icon.svg-ec846f788d42e90042ed8dcf2b3e17b0.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/orbit_camera/plugin.cfg b/addons/orbit_camera/plugin.cfg index 0a7f42d..bb2aed2 100644 --- a/addons/orbit_camera/plugin.cfg +++ b/addons/orbit_camera/plugin.cfg @@ -4,4 +4,4 @@ name="OrbitCamera" description="" author="MrDev023" version="0.3" -script="orbit_camera.gd" +script="plugin.gd" diff --git a/addons/orbit_camera/plugin.gd b/addons/orbit_camera/plugin.gd new file mode 100644 index 0000000..af829a7 --- /dev/null +++ b/addons/orbit_camera/plugin.gd @@ -0,0 +1,8 @@ +tool +extends EditorPlugin + +func _enter_tree(): + add_custom_type("OrbitCamera", "Camera", preload("res://addons/orbit_camera/orbit_camera.gd"), preload("res://addons/orbit_camera/orbit_camera_icon.svg")) + +func _exit_tree(): + remove_custom_type("OrbitCamera")