This commit is contained in:
CortexCore 2023-11-30 00:27:34 +08:00
parent 7712c80804
commit 337840ebb3
30 changed files with 787 additions and 62 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bmr3tcmo7aptd"
path.s3tc="res://.godot/imported/Premium Vector _ High tech technology geometric 1_blur.png-b1505ae6501627e344f1425539dc490b.s3tc.ctex"
path.etc2="res://.godot/imported/Premium Vector _ High tech technology geometric 1_blur.png-b1505ae6501627e344f1425539dc490b.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://iFactory/Art/Backgrounds/Premium Vector _ High tech technology geometric 1_blur.png"
dest_files=["res://.godot/imported/Premium Vector _ High tech technology geometric 1_blur.png-b1505ae6501627e344f1425539dc490b.s3tc.ctex", "res://.godot/imported/Premium Vector _ High tech technology geometric 1_blur.png-b1505ae6501627e344f1425539dc490b.etc2.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://deo1d6nujoayd"
path.s3tc="res://.godot/imported/Premium Vector _ High tech technology geometric.jpg-68327be1dc0ae079264e965f3ed11da5.s3tc.ctex"
path.etc2="res://.godot/imported/Premium Vector _ High tech technology geometric.jpg-68327be1dc0ae079264e965f3ed11da5.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://iFactory/Art/Backgrounds/Premium Vector _ High tech technology geometric.jpg"
dest_files=["res://.godot/imported/Premium Vector _ High tech technology geometric.jpg-68327be1dc0ae079264e965f3ed11da5.s3tc.ctex", "res://.godot/imported/Premium Vector _ High tech technology geometric.jpg-68327be1dc0ae079264e965f3ed11da5.etc2.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@ -0,0 +1,40 @@
[gd_resource type="ShaderMaterial" load_steps=4 format=3 uid="uid://b87exaga7dj30"]
[sub_resource type="VisualShaderNodeColorConstant" id="VisualShaderNodeColorConstant_l726l"]
constant = Color(0, 0.904031, 0.904031, 1)
[sub_resource type="VisualShaderNodeFresnel" id="VisualShaderNodeFresnel_d3cln"]
[sub_resource type="VisualShader" id="VisualShader_fn7bo"]
code = "shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_lambert, specular_schlick_ggx;
void fragment() {
// ColorConstant:2
vec4 n_out2p0 = vec4(0.000000, 0.904031, 0.904031, 1.000000);
// Fresnel:6
float n_in6p3 = 1.00000;
float n_out6p0 = pow(1.0 - clamp(dot(NORMAL, VIEW), 0.0, 1.0), n_in6p3);
// Output:0
ALBEDO = vec3(n_out2p0.xyz);
ALPHA = n_out6p0;
}
"
nodes/fragment/2/node = SubResource("VisualShaderNodeColorConstant_l726l")
nodes/fragment/2/position = Vector2(-180, 0)
nodes/fragment/6/node = SubResource("VisualShaderNodeFresnel_d3cln")
nodes/fragment/6/position = Vector2(-120, 220)
nodes/fragment/connections = PackedInt32Array(6, 0, 0, 1, 2, 0, 0, 0)
[resource]
render_priority = 0
shader = SubResource("VisualShader_fn7bo")

38
Artists/Models/Unlit.tres Normal file
View File

@ -0,0 +1,38 @@
[gd_resource type="VisualShader" load_steps=4 format=3 uid="uid://ctup8ch7g8d8"]
[ext_resource type="Texture2D" uid="uid://deo1d6nujoayd" path="res://iFactory/Art/Backgrounds/Premium Vector _ High tech technology geometric.jpg" id="1_ho0r1"]
[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_pnmq1"]
output_port_for_preview = 0
texture = ExtResource("1_ho0r1")
texture_type = 1
[sub_resource type="VisualShaderNodeFloatConstant" id="VisualShaderNodeFloatConstant_20cju"]
output_port_for_preview = 0
[resource]
code = "shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_lambert, specular_schlick_ggx;
uniform sampler2D tex_frg_2 : source_color;
void fragment() {
// Texture2D:2
vec4 n_out2p0 = texture(tex_frg_2, UV);
// Output:0
ALBEDO = vec3(n_out2p0.xyz);
EMISSION = vec3(n_out2p0.xyz);
}
"
graph_offset = Vector2(-527.376, 50.6207)
nodes/fragment/2/node = SubResource("VisualShaderNodeTexture_pnmq1")
nodes/fragment/2/position = Vector2(-400, 180)
nodes/fragment/3/node = SubResource("VisualShaderNodeFloatConstant_20cju")
nodes/fragment/3/position = Vector2(-60, 420)
nodes/fragment/connections = PackedInt32Array(2, 0, 0, 0, 2, 0, 0, 5)

View File

@ -0,0 +1,7 @@
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://1f48mi0qdcmk"]
[ext_resource type="Shader" uid="uid://ctup8ch7g8d8" path="res://iFactory/Models/Unlit.tres" id="1_1ww7w"]
[resource]
render_priority = 0
shader = ExtResource("1_1ww7w")

Binary file not shown.

View File

@ -0,0 +1,40 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bx67ttb7q3kxd"
path="res://.godot/imported/arrow_mark.fbx-f40d0c044a45f5bb3ff5a4c514a98347.scn"
[deps]
source_file="res://iFactory/Models/arrow_mark.fbx"
dest_files=["res://.godot/imported/arrow_mark.fbx-f40d0c044a45f5bb3ff5a4c514a98347.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={
"materials": {
"DefaultMaterial": {
"use_external/enabled": true,
"use_external/path": "res://iFactory/Materials/Material_Color_Blue.tres"
}
}
}
gltf/embedded_image_handling=1

BIN
Artists/Models/dev_quad.fbx Normal file

Binary file not shown.

View File

@ -0,0 +1,33 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://oxbs00e73evc"
path="res://.godot/imported/dev_quad.fbx-8c45f996efa1c351469d96a34ce65636.scn"
[deps]
source_file="res://iFactory/Models/dev_quad.fbx"
dest_files=["res://.godot/imported/dev_quad.fbx-8c45f996efa1c351469d96a34ce65636.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/embedded_image_handling=1

Binary file not shown.

View File

@ -0,0 +1,40 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://brc1yhikmpf25"
path="res://.godot/imported/dev_quad_1080p.fbx-460bafeb5b050cb0745a7ffe855f94e9.scn"
[deps]
source_file="res://iFactory/Models/dev_quad_1080p.fbx"
dest_files=["res://.godot/imported/dev_quad_1080p.fbx-460bafeb5b050cb0745a7ffe855f94e9.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={
"materials": {
"Material": {
"use_external/enabled": true,
"use_external/path": "res://iFactory/Models/Unlit_Dev_1080p.tres"
}
}
}
gltf/embedded_image_handling=1

View File

@ -9,54 +9,21 @@ public partial class PathRenderer : EntityBehaviour
{
[Export] private DeviceValueComponent valueComponent;
[Export] private Node3D root;
[Export] private Path3D path3D;
private readonly List<MeshInstance3D> meshInstances=new();
public override void OnAwake()
{
base.OnAwake();
valueComponent.OnValueChanged += OnValueChanged;
}
private void OnValueChanged(string arg1, DateTime arg2)
{
foreach (var x in meshInstances)
{
x.QueueFree();
}
meshInstances.Clear();
Vector3 lastPoint = Vector3.Zero;
path3D.Curve.ClearPoints();
foreach (var pair in JArray.Parse(arg1))
{
var x = pair["X"]!.ToObject<float>()!;
var y = pair["Y"]!.ToObject<float>()!;
var currentPoint =root.Position + new Vector3(x, 0, y);
if (lastPoint != Vector3.Zero)
{
meshInstances.Add(Line(lastPoint, currentPoint,Colors.Orange));
path3D.Curve.AddPoint(new Vector3(x,0,y));
}
lastPoint = currentPoint;
}
}
public static MeshInstance3D Line(Vector3 pos1, Vector3 pos2, Color? color = null)
{
var meshInstance = new MeshInstance3D();
var immediateMesh = new ImmediateMesh();
var material = new StandardMaterial3D();
meshInstance.Mesh = immediateMesh;
meshInstance.CastShadow = GeometryInstance3D.ShadowCastingSetting.Off;
immediateMesh.SurfaceBegin(Mesh.PrimitiveType.Lines, material);
immediateMesh.SurfaceAddVertex(pos1);
immediateMesh.SurfaceAddVertex(pos2);
immediateMesh.SurfaceEnd();
material.ShadingMode = BaseMaterial3D.ShadingModeEnum.Unshaded;
material.AlbedoColor = color ?? Colors.WhiteSmoke;
(Engine.GetMainLoop() as SceneTree).Root.AddChild(meshInstance);
return meshInstance;
}
}

View File

@ -0,0 +1,29 @@
using Godot;
using System;
namespace BITFactory;
public partial class AutoFollowPath : PathFollow3D
{
[Export] private float speed;
[Export] private bool useRatio;
private float _progress;
public override void _Ready()
{
base._Ready();
_progress = Progress;
}
public override void _Process(double delta)
{
_progress += speed * (float)delta;
if (useRatio)
{
ProgressRatio = _progress%1;
}
else
{ Progress = _progress;
}
}
}

View File

@ -0,0 +1,100 @@
[gd_resource type="VisualShader" load_steps=9 format=3 uid="uid://cvh50bp24qxc7"]
[sub_resource type="VisualShaderNodeFloatOp" id="VisualShaderNodeFloatOp_6kj05"]
default_input_values = [0, 0.0, 1, 1.0]
operator = 2
[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_516n7"]
source = 5
[sub_resource type="VisualShaderNodeTexture2DParameter" id="VisualShaderNodeTexture2DParameter_atuf8"]
parameter_name = "MainTexture"
texture_repeat = 2
[sub_resource type="VisualShaderNodeVectorDecompose" id="VisualShaderNodeVectorDecompose_a3maj"]
default_input_values = [0, Quaternion(0, 0, 0, 0)]
op_type = 2
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_re64m"]
input_name = "time"
[sub_resource type="VisualShaderNodeUVFunc" id="VisualShaderNodeUVFunc_6jmon"]
default_input_values = [1, Vector2(1, 1), 2, Vector2(0.5, 0.5)]
function = 1
[sub_resource type="VisualShaderNodeFloatOp" id="VisualShaderNodeFloatOp_j1u65"]
default_input_values = [0, 0.0, 1, 1.0]
operator = 4
[sub_resource type="VisualShaderNodeFloatOp" id="VisualShaderNodeFloatOp_t6ivt"]
default_input_values = [0, 2.0, 1, 1.0]
operator = 1
[resource]
code = "shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_lambert, specular_schlick_ggx;
uniform sampler2D MainTexture : repeat_disable;
void fragment() {
// Input:5
float n_out5p0 = TIME;
// FloatOp:8
float n_in8p1 = 1.00000;
float n_out8p0 = mod(n_out5p0, n_in8p1);
// FloatOp:9
float n_in9p0 = 2.00000;
float n_out9p0 = n_in9p0 - n_out8p0;
// UVFunc:7
vec2 n_in7p2 = vec2(0.50000, 0.50000);
vec2 n_out7p0 = (UV - n_in7p2) * vec2(n_out9p0) + n_in7p2;
vec4 n_out2p0;
// Texture2D:2
n_out2p0 = texture(MainTexture, n_out7p0);
// VectorDecompose:4
float n_out4p0 = n_out2p0.x;
float n_out4p1 = n_out2p0.y;
float n_out4p2 = n_out2p0.z;
float n_out4p3 = n_out2p0.w;
// FloatOp:10
float n_out10p0 = n_out4p3 * n_out8p0;
// Output:0
ALBEDO = vec3(n_out2p0.xyz);
ALPHA = n_out10p0;
}
"
nodes/fragment/2/node = SubResource("VisualShaderNodeTexture_516n7")
nodes/fragment/2/position = Vector2(-1340, 560)
nodes/fragment/3/node = SubResource("VisualShaderNodeTexture2DParameter_atuf8")
nodes/fragment/3/position = Vector2(-1920, 720)
nodes/fragment/4/node = SubResource("VisualShaderNodeVectorDecompose_a3maj")
nodes/fragment/4/position = Vector2(-740, 600)
nodes/fragment/5/node = SubResource("VisualShaderNodeInput_re64m")
nodes/fragment/5/position = Vector2(-2660, 560)
nodes/fragment/7/node = SubResource("VisualShaderNodeUVFunc_6jmon")
nodes/fragment/7/position = Vector2(-1620, 500)
nodes/fragment/8/node = SubResource("VisualShaderNodeFloatOp_j1u65")
nodes/fragment/8/position = Vector2(-2260, 300)
nodes/fragment/9/node = SubResource("VisualShaderNodeFloatOp_t6ivt")
nodes/fragment/9/position = Vector2(-1940, 420)
nodes/fragment/10/node = SubResource("VisualShaderNodeFloatOp_6kj05")
nodes/fragment/10/position = Vector2(-160, 480)
nodes/fragment/connections = PackedInt32Array(3, 0, 2, 2, 7, 0, 2, 0, 5, 0, 8, 0, 8, 0, 9, 1, 9, 0, 7, 1, 4, 3, 10, 0, 8, 0, 10, 1, 2, 0, 4, 0, 2, 0, 0, 0, 10, 0, 0, 1)

View File

@ -0,0 +1,125 @@
[gd_resource type="VisualShader" load_steps=11 format=3 uid="uid://cn6f4k74cxkkn"]
[ext_resource type="Script" path="res://addons/VisualShaderExtras/UV/UVRotate.gd" id="1_4i8x8"]
[sub_resource type="VisualShaderNodeVectorDecompose" id="VisualShaderNodeVectorDecompose_1asv8"]
default_input_values = [0, Quaternion(0, 0, 0, 0)]
op_type = 2
[sub_resource type="VisualShaderNodeUVFunc" id="VisualShaderNodeUVFunc_s0gv3"]
default_input_values = [1, Vector2(-4, 8), 2, Vector2(0, 0)]
function = 1
[sub_resource type="VisualShaderNodeCustom" id="VisualShaderNodeCustom_1swn8"]
default_input_values = [1, Vector2(0, 0), 2, 0.0, 3, Vector2(0, 0)]
initialized = true
script = ExtResource("1_4i8x8")
[sub_resource type="VisualShaderNodeTexture2DParameter" id="VisualShaderNodeTexture2DParameter_8ck2a"]
parameter_name = "MainTexture"
[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_15o2w"]
source = 5
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_ku0fj"]
input_name = "time"
[sub_resource type="VisualShaderNodeUVFunc" id="VisualShaderNodeUVFunc_g8x7a"]
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_efnhw"]
input_name = "uv"
[sub_resource type="VisualShaderNodeVectorCompose" id="VisualShaderNodeVectorCompose_vnmsm"]
op_type = 0
[resource]
code = "shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_lambert, specular_schlick_ggx;
uniform sampler2D MainTexture;
// UVRotate
vec2 uv_rotate(vec2 uv, vec2 pivot, float angle) {
mat2 rotation = mat2(vec2(sin(angle), -cos(angle)), vec2(cos(angle), sin(angle)));
uv -= pivot;
uv = uv * rotation;
uv += pivot;
return uv;
}
void fragment() {
// Input:6
vec2 n_out6p0 = UV;
// UVFunc:16
vec2 n_in16p1 = vec2(-4.00000, 8.00000);
vec2 n_in16p2 = vec2(0.00000, 0.00000);
vec2 n_out16p0 = (n_out6p0 - n_in16p2) * n_in16p1 + n_in16p2;
// Input:4
float n_out4p0 = TIME;
// VectorCompose:7
float n_in7p1 = 0.00000;
vec2 n_out7p0 = vec2(n_out4p0, n_in7p1);
// UVFunc:5
vec2 n_in5p1 = vec2(1.00000, 1.00000);
vec2 n_out5p0 = n_out7p0 * n_in5p1 + n_out16p0;
vec2 n_out17p0;
// UVRotate:17
vec2 n_in17p1 = vec2(0.00000, 0.00000);
float n_in17p2 = 0.00000;
{
n_out17p0.xy = uv_rotate(n_out5p0.xy, n_in17p1.xy, n_in17p2);
}
vec4 n_out3p0;
// Texture2D:3
n_out3p0 = texture(MainTexture, n_out17p0);
// VectorDecompose:14
float n_out14p0 = n_out3p0.x;
float n_out14p1 = n_out3p0.y;
float n_out14p2 = n_out3p0.z;
float n_out14p3 = n_out3p0.w;
// Output:0
ALBEDO = vec3(n_out3p0.xyz);
ALPHA = n_out14p3;
EMISSION = vec3(n_out3p0.xyz);
}
"
nodes/fragment/2/node = SubResource("VisualShaderNodeTexture2DParameter_8ck2a")
nodes/fragment/2/position = Vector2(-1080, 240)
nodes/fragment/3/node = SubResource("VisualShaderNodeTexture_15o2w")
nodes/fragment/3/position = Vector2(-180, 140)
nodes/fragment/4/node = SubResource("VisualShaderNodeInput_ku0fj")
nodes/fragment/4/position = Vector2(-1480, 80)
nodes/fragment/5/node = SubResource("VisualShaderNodeUVFunc_g8x7a")
nodes/fragment/5/position = Vector2(-660, -80)
nodes/fragment/6/node = SubResource("VisualShaderNodeInput_efnhw")
nodes/fragment/6/position = Vector2(-1820, -120)
nodes/fragment/7/node = SubResource("VisualShaderNodeVectorCompose_vnmsm")
nodes/fragment/7/position = Vector2(-1000, 40)
nodes/fragment/14/node = SubResource("VisualShaderNodeVectorDecompose_1asv8")
nodes/fragment/14/position = Vector2(-140, 420)
nodes/fragment/16/node = SubResource("VisualShaderNodeUVFunc_s0gv3")
nodes/fragment/16/position = Vector2(-1040, -160)
nodes/fragment/17/node = SubResource("VisualShaderNodeCustom_1swn8")
nodes/fragment/17/position = Vector2(-380, -40)
nodes/fragment/connections = PackedInt32Array(2, 0, 3, 2, 3, 0, 0, 0, 7, 0, 5, 2, 3, 0, 14, 0, 16, 0, 5, 0, 4, 0, 7, 0, 6, 0, 16, 0, 5, 0, 17, 0, 17, 0, 3, 0, 14, 3, 0, 1, 3, 0, 0, 5)

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://dey6r76kttak6"]
[ext_resource type="Texture2D" uid="uid://dhws1cqlkdixm" path="res://Artists/Art/Icons/icon_folder.png" id="1_ipnal"]
[ext_resource type="Texture2D" uid="uid://dhws1cqlkdixm" path="res://iFactory/Art/Icons/icon_folder.png" id="1_ipnal"]
[ext_resource type="Script" path="res://BITKit/Scripts/UX/UXTabViewService.cs" id="3_7cg45"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uocfi"]

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,73 @@
[gd_scene load_steps=3 format=3 uid="uid://ct0fusesb1dud"]
[ext_resource type="Script" path="res://BITKit/Scripts/UX/UXSettings.cs" id="1_q3u5u"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ywobr"]
bg_color = Color(0, 0, 0, 0.870588)
[node name="UXSettings" type="Control" node_paths=PackedStringArray("uiScaleSlider", "renderResolutionSlider")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_q3u5u")
uiScaleSlider = NodePath("PanelContainer/MarginContainer/HBoxContainer/VBoxContainer/GridContainer/HSlider")
renderResolutionSlider = NodePath("PanelContainer/MarginContainer/HBoxContainer/VBoxContainer/GridContainer/HSlider2")
[node name="PanelContainer" type="PanelContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_ywobr")
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/MarginContainer"]
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="GridContainer" type="GridContainer" parent="PanelContainer/MarginContainer/HBoxContainer/VBoxContainer"]
layout_mode = 2
columns = 2
[node name="Label" type="Label" parent="PanelContainer/MarginContainer/HBoxContainer/VBoxContainer/GridContainer"]
layout_mode = 2
text = "屏幕空间缩放"
[node name="HSlider" type="HSlider" parent="PanelContainer/MarginContainer/HBoxContainer/VBoxContainer/GridContainer"]
custom_minimum_size = Vector2(512, 0)
layout_mode = 2
size_flags_horizontal = 3
min_value = 1.0
max_value = 2.5
step = 0.1
value = 1.0
[node name="Label2" type="Label" parent="PanelContainer/MarginContainer/HBoxContainer/VBoxContainer/GridContainer"]
layout_mode = 2
text = "渲染分辨率倍数"
[node name="HSlider2" type="HSlider" parent="PanelContainer/MarginContainer/HBoxContainer/VBoxContainer/GridContainer"]
custom_minimum_size = Vector2(512, 0)
layout_mode = 2
size_flags_horizontal = 3
min_value = 0.5
max_value = 2.0
step = 0.1
value = 1.0
[node name="Label3" type="Label" parent="PanelContainer/MarginContainer/HBoxContainer/VBoxContainer/GridContainer"]
layout_mode = 2
text = "渲染分辨率倍数"
[node name="CheckBox" type="CheckBox" parent="PanelContainer/MarginContainer/HBoxContainer/VBoxContainer/GridContainer"]
layout_mode = 2

View File

@ -7,8 +7,8 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace BITKit.Apps;
public partial class GodotBasedApplicationService:EntityComponent, IApplicationService
[CustomType(typeof(IApplicationService))]
public partial class GodotBasedApplicationService:EntityBehaviour, IApplicationService
{
private static readonly System.Net.Http.HttpClient _httpClient = new();
[Export] public string DownloadLatestUrl { get; set; }
@ -21,20 +21,14 @@ public partial class GodotBasedApplicationService:EntityComponent, IApplicationS
public event Action<string> OnDownloadComplete;
public event Action OnDetectedLatestVersion;
private ILogger<IApplicationService> _logger;
public override void BuildService(IServiceCollection serviceCollection)
{
serviceCollection.AddSingleton<IApplicationService>(this);
}
public override async void OnStart()
{
_logger = Entity.ServiceProvider.GetRequiredService<ILogger<IApplicationService>>();
BIT4Log.Log<IApplicationService>("正在初始化...");
var clientVersion = ProjectSettings.GetSetting("application/config/version").AsString();
_logger.LogInformation($"当前版本:{clientVersion}");
BIT4Log.Log<IApplicationService>($"当前版本:{clientVersion}");
OnClientVersionCheck?.Invoke(clientVersion);
@ -52,7 +46,7 @@ public partial class GodotBasedApplicationService:EntityComponent, IApplicationS
OnDetectedLatestVersion?.Invoke();
}
_logger.LogInformation($"最新版本:{version}");
BIT4Log.Log<IApplicationService>($"最新版本:{version}");
}
public UniTask<string> DownloadLatestVersionAsync()

View File

@ -12,7 +12,7 @@ public partial class FreeLookCamera : Node3D,IVirtualCamera
[Export]
private Curve wheelCurve;
[Export(PropertyHint.Range,"0.32,8")]
[Export(PropertyHint.Range,"0.32,64")]
private float distance;
[Export] private float maxDistance;

View File

@ -84,5 +84,10 @@ public partial class BITAppForGodot : Node
public override void _Process(double delta)
{
DeltaTime =(float) delta;
// var scale = DisplayServer.WindowGetSize().X / 1920f;
// //GetViewport().Scaling3DScale = scale;
//
// //ProjectSettings.SetSetting("display/window/stretch/scale", scale);
}
}

View File

@ -0,0 +1,67 @@
using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
namespace BITKit.StateMachine
{
public abstract partial class StateMachineNode<T> : Node ,IStateMachine<T> where T : class, IState
{
public bool Enabled { get; set; }
public T CurrentState { get; set; }
public event Action<T, T> OnStateChanged;
public IDictionary<Type, T> StateDictionary { get; } = new Dictionary<Type, T>();
public void Initialize()
{
foreach (var x in StateDictionary)
{
x.Value.Initialize();
}
}
public void UpdateState(float deltaTime)
{
CurrentState?.OnStateUpdate(deltaTime);
}
public void DisposeState()
{
CurrentState?.OnStateExit(CurrentState,null);
CurrentState = null;
}
public void TransitionState<State>() where State : T
{
TransitionState(StateDictionary[typeof(State)]);
}
public void TransitionState(T state)
{
CurrentState?.OnStateExit(CurrentState, state);
var previousState = CurrentState;
CurrentState = state;
state.OnStateEntry(previousState);
OnStateChanged?.Invoke(previousState, CurrentState);
CurrentState = state;
}
public override void _Ready()
{
base._Ready();
foreach (var x in MathNode.GetAllNode(this).OfType<T>())
{
StateDictionary.Add(x.GetType(), x);
}
Initialize();
if (StateDictionary.Count > 0)
TransitionState(StateDictionary.First().Value);
}
public override void _Process(double delta)
{
base._Process(delta);
CurrentState?.OnStateUpdate((float)delta);
}
}
}

View File

@ -0,0 +1,24 @@
using Godot;
using System;
namespace BITKit.StateMachine;
public partial class StateNode : Node, IState
{
public virtual bool Enabled { get; set; }
public virtual void Initialize()
{
}
public virtual void OnStateEntry(IState old)
{
}
public virtual void OnStateUpdate(float deltaTime)
{
}
public virtual void OnStateExit(IState old, IState newState)
{
}
}

View File

@ -5,18 +5,16 @@ using Microsoft.Extensions.DependencyInjection;
namespace BITKit;
public partial class UXApplicationService : EntityComponent
public partial class UXApplicationService : EntityBehaviour
{
[Export] private Label currentVersionLabel;
[Export] private Label latestVersionLabel;
[Export] private Button downloadLatestButton;
[Inject]
private IApplicationService _service;
public override void OnAwake()
{
_service = Entity.ServiceProvider.GetRequiredService<IApplicationService>();
downloadLatestButton.Hide();
downloadLatestButton.Pressed += () =>

View File

@ -1,5 +1,6 @@
using Godot;
using System;
using Cysharp.Threading.Tasks;
namespace BITKit.UX;
@ -17,17 +18,39 @@ public partial class UXPanel : Control, IUXPanel
public bool AllowInput => allowInput;
private string _index;
public bool IsEntered { get; set; }
public virtual void Entry()
{
Show();
//OnEntry();
}
public UniTask EntryAsync()
{
return UniTask.CompletedTask;
}
public void Entered()
{
}
public virtual void Exit()
{
Hide();
//OnExit();
}
public UniTask ExitAsync()
{
return UniTask.CompletedTask;
}
public void Exited()
{
}
public event Action OnEntry;
public event Action OnExit;
@ -55,4 +78,9 @@ public partial class UXPanel : Control, IUXPanel
UXService.UnRegister(this);
IsValid = false;
}
public void OnUpdate(float deltaTime)
{
throw new NotImplementedException();
}
}

View File

@ -13,6 +13,6 @@ public partial class UXProfiler : Node
if (fpsLabel is not null)
fpsLabel.Text = $"FPS: {Engine.GetFramesPerSecond()}";
if (resolutionLabel is not null)
resolutionLabel.Text = $"Resolution: {windowSize.X}x{windowSize.Y}";
resolutionLabel.Text = $"{windowSize.X}x{windowSize.Y}";
}
}

View File

@ -0,0 +1,36 @@
using Godot;
using System;
namespace BITKit.UX.Settings;
public partial class UXSettings : Node
{
[Export] private Slider uiScaleSlider;
[Export] private Slider renderResolutionSlider;
[Export] private CheckBox fullScreenCheckBox;
public override void _Ready()
{
base._Ready();
uiScaleSlider.ValueChanged += SetUIScale;
renderResolutionSlider.ValueChanged += SetRenderResolution;
fullScreenCheckBox.Toggled += SetFullScreen;
}
private void SetFullScreen(bool toggledon)
{
DisplayServer.WindowSetMode(toggledon ? DisplayServer.WindowMode.Fullscreen:DisplayServer.WindowMode.Minimized);
BIT4Log.Log<UXSettings>($"设置全屏为{toggledon}");
}
public void SetUIScale(double scale)
{
//GetViewport().Scaling3DScale =(float) scale;
BIT4Log.Log<UXSettings>($"设置UI缩放比例为{scale}");
}
public void SetRenderResolution(double scale)
{
GetViewport().Scaling3DScale = (float)scale;
BIT4Log.Log<UXSettings>($"设置渲染分辨率比例为{scale}");
}
}

View File

@ -18,6 +18,8 @@ public partial class HttpGet : Node,IActivable
public bool Enabled { get; set; } = true;
[Signal]
public delegate void OnGetEventHandler(string httpContext);
[Signal]
public delegate void OnExceptionEventHandler(string exception);
/// <summary>
/// 请求数据的间隔
/// </summary>
@ -73,6 +75,10 @@ public partial class HttpGet : Node,IActivable
catch (OperationCanceledException)
{
}
catch (Exception e)
{
EmitSignal(nameof(OnException), e.Message);
}
allowNextRequest = true;
}