add simple runtime; fix the issue of crashing when creating file and folder; some tweaks
This commit is contained in:
@ -12,7 +12,7 @@ file(COPY ${IMGUI_INI} DESTINATION ${CMAKE_BINARY_DIR})
|
||||
file(GLOB DOTNET_LIBRARY library)
|
||||
file(COPY ${DOTNET_LIBRARY} DESTINATION ${CMAKE_BINARY_DIR})
|
||||
|
||||
file(GLOB_RECURSE SRC_SOURCE ./**.cpp)
|
||||
file(GLOB_RECURSE SRC_SOURCE ./Editor/**.cpp)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SRC_SOURCE})
|
||||
|
||||
|
||||
@ -51,8 +51,11 @@ namespace Prism
|
||||
NewScene();
|
||||
m_CurrentScene = m_EditorScene;
|
||||
|
||||
SceneRenderer::GetOptions().ShowGrid = true;
|
||||
|
||||
AssetEditorPanel::RegisterDefaultEditors();
|
||||
FileSystem::StartWatching();
|
||||
|
||||
}
|
||||
|
||||
void EditorLayer::OnDetach()
|
||||
@ -105,7 +108,7 @@ namespace Prism
|
||||
Renderer::BeginRenderPass(SceneRenderer::GetFinalRenderPass(), false);
|
||||
const auto viewProj = m_EditorCamera.GetViewProjection();
|
||||
Renderer2D::BeginScene(viewProj, false);
|
||||
Renderer2D::DrawRotatedRect({ transform.Translation.x + collider.Offset.x, transform.Translation.y + collider.Offset.y }, {transform.Scale.x * collider.Size.x, transform.Scale.y * collider.Size.y}, transform.Rotation.z, { 0.0f, 0.0f, 1.0f, 1.0f });
|
||||
Renderer2D::DrawRotatedRect({ transform.Translation.x + collider.Offset.x, transform.Translation.y + collider.Offset.y , transform.Translation.z}, {transform.Scale.x * collider.Size.x, transform.Scale.y * collider.Size.y}, transform.Rotation.z, { 0.0f, 0.0f, 1.0f, 1.0f });
|
||||
Renderer2D::EndScene();
|
||||
Renderer::EndRenderPass();
|
||||
}
|
||||
@ -117,7 +120,7 @@ namespace Prism
|
||||
Renderer::BeginRenderPass(SceneRenderer::GetFinalRenderPass(), false);
|
||||
const auto viewProj = m_EditorCamera.GetViewProjection();
|
||||
Renderer2D::BeginScene(viewProj, false);
|
||||
Renderer2D::DrawCircle({ transform.Translation.x + collider.Offset.x, transform.Translation.y + collider.Offset.y}, collider.Radius, { 0.0f, 1.0f, 1.0f, 1.0f });
|
||||
Renderer2D::DrawCircle({ transform.Translation.x + collider.Offset.x, transform.Translation.y + collider.Offset.y, transform.Translation.z}, collider.Radius, { 0.0f, 1.0f, 1.0f, 1.0f });
|
||||
Renderer2D::EndScene();
|
||||
Renderer::EndRenderPass();
|
||||
}
|
||||
@ -237,7 +240,7 @@ namespace Prism
|
||||
{
|
||||
// temp
|
||||
if (ImGui::MenuItem("Reload C# Assembly"))
|
||||
ScriptEngine::ReloadAssembly("assets/scripts/ExampleApp.dll");
|
||||
ScriptEngine::ReloadAssembly("assets/scripts/Assembly-Script.dll");
|
||||
|
||||
ImGui::MenuItem("Reload assembly on play", nullptr, &m_ReloadScriptOnPlay);
|
||||
ImGui::EndMenu();
|
||||
@ -1054,17 +1057,6 @@ namespace Prism
|
||||
});
|
||||
if (!m_SelectionContext.empty())
|
||||
{
|
||||
if (auto alreadySelectedEntity = m_SceneHierarchyPanel->GetSelected();
|
||||
m_SelectionContext.size() != 1 && alreadySelectedEntity)
|
||||
{
|
||||
const auto alreadySelectedEntityID = alreadySelectedEntity.GetUUID();
|
||||
|
||||
for (const auto& selectedEntity : m_SelectionContext)
|
||||
{
|
||||
if (alreadySelectedEntityID == selectedEntity.Entity.GetUUID()) continue;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
OnSelected(m_SelectionContext[0]);
|
||||
}
|
||||
}
|
||||
|
||||
336
Editor/assets/scenes/FPS.scene
Normal file
336
Editor/assets/scenes/FPS.scene
Normal file
@ -0,0 +1,336 @@
|
||||
Scene: Scene Name
|
||||
Environment:
|
||||
AssetHandle: 5211537204242875091
|
||||
Entities:
|
||||
- Entity: 8293051279669100759
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [1.736814, 1.4724115, -4.2181306]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
MeshComponent:
|
||||
AssetID: 18328012085543462741
|
||||
AssetPath: assets/meshes/Default/Cube.fbx
|
||||
RigidBodyComponent:
|
||||
BodyType: 1
|
||||
Mass: 1
|
||||
LinearDrag: 0
|
||||
AngularDrag: 0.05
|
||||
DisableGravity: false
|
||||
IsKinematic: false
|
||||
Layer: 0
|
||||
Constraints:
|
||||
LockPositionX: false
|
||||
LockPositionY: false
|
||||
LockPositionZ: false
|
||||
LockRotationX: false
|
||||
LockRotationY: false
|
||||
LockRotationZ: false
|
||||
BoxColliderComponent:
|
||||
Offset: [0, 0, 0]
|
||||
Size: [2, 2, 2]
|
||||
IsTrigger: false
|
||||
Material: 0
|
||||
MaterialPath: ""
|
||||
- Entity: 5834225236589765516
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [-2.6417403, 1.4724115, -7.9285727]
|
||||
Rotation: [0.52199936, 0, 0]
|
||||
Scale: [1, 1.0000001, 1.0000001]
|
||||
MeshComponent:
|
||||
AssetID: 18328012085543462741
|
||||
AssetPath: assets/meshes/Default/Cube.fbx
|
||||
RigidBodyComponent:
|
||||
BodyType: 1
|
||||
Mass: 1
|
||||
LinearDrag: 0
|
||||
AngularDrag: 0.05
|
||||
DisableGravity: false
|
||||
IsKinematic: false
|
||||
Layer: 0
|
||||
Constraints:
|
||||
LockPositionX: false
|
||||
LockPositionY: false
|
||||
LockPositionZ: false
|
||||
LockRotationX: false
|
||||
LockRotationY: false
|
||||
LockRotationZ: false
|
||||
BoxColliderComponent:
|
||||
Offset: [0, 0, 0]
|
||||
Size: [2, 2, 2]
|
||||
IsTrigger: false
|
||||
Material: 0
|
||||
MaterialPath: ""
|
||||
- Entity: 8234256119181302872
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [1.736814, 1.4724115, -7.9285727]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
MeshComponent:
|
||||
AssetID: 18328012085543462741
|
||||
AssetPath: assets/meshes/Default/Cube.fbx
|
||||
RigidBodyComponent:
|
||||
BodyType: 1
|
||||
Mass: 1
|
||||
LinearDrag: 0
|
||||
AngularDrag: 0.05
|
||||
DisableGravity: false
|
||||
IsKinematic: false
|
||||
Layer: 0
|
||||
Constraints:
|
||||
LockPositionX: false
|
||||
LockPositionY: false
|
||||
LockPositionZ: false
|
||||
LockRotationX: false
|
||||
LockRotationY: false
|
||||
LockRotationZ: false
|
||||
BoxColliderComponent:
|
||||
Offset: [0, 0, 0]
|
||||
Size: [2, 2, 2]
|
||||
IsTrigger: false
|
||||
Material: 0
|
||||
MaterialPath: ""
|
||||
- Entity: 12935252585493481950
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [-1.5106764, 6.237644, -4.2181306]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
MeshComponent:
|
||||
AssetID: 18328012085543462741
|
||||
AssetPath: assets/meshes/Default/Cube.fbx
|
||||
RigidBodyComponent:
|
||||
BodyType: 1
|
||||
Mass: 1
|
||||
LinearDrag: 0
|
||||
AngularDrag: 0.05
|
||||
DisableGravity: false
|
||||
IsKinematic: false
|
||||
Layer: 0
|
||||
Constraints:
|
||||
LockPositionX: false
|
||||
LockPositionY: false
|
||||
LockPositionZ: false
|
||||
LockRotationX: false
|
||||
LockRotationY: false
|
||||
LockRotationZ: false
|
||||
BoxColliderComponent:
|
||||
Offset: [0, 0, 0]
|
||||
Size: [2, 2, 2]
|
||||
IsTrigger: false
|
||||
Material: 0
|
||||
MaterialPath: ""
|
||||
- Entity: 3328246672296261054
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [1.736814, 1.4724115, -0.88378817]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
MeshComponent:
|
||||
AssetID: 18328012085543462741
|
||||
AssetPath: assets/meshes/Default/Cube.fbx
|
||||
RigidBodyComponent:
|
||||
BodyType: 1
|
||||
Mass: 1
|
||||
LinearDrag: 0
|
||||
AngularDrag: 0.05
|
||||
DisableGravity: false
|
||||
IsKinematic: false
|
||||
Layer: 0
|
||||
Constraints:
|
||||
LockPositionX: false
|
||||
LockPositionY: false
|
||||
LockPositionZ: false
|
||||
LockRotationX: false
|
||||
LockRotationY: false
|
||||
LockRotationZ: false
|
||||
BoxColliderComponent:
|
||||
Offset: [0, 0, 0]
|
||||
Size: [2, 2, 2]
|
||||
IsTrigger: false
|
||||
Material: 0
|
||||
MaterialPath: ""
|
||||
- Entity: 4208267561919679628
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [-2.6417403, 1.4724115, -4.8956265]
|
||||
Rotation: [-0.4034239, 0, 0]
|
||||
Scale: [1, 0.99999994, 0.99999994]
|
||||
MeshComponent:
|
||||
AssetID: 18328012085543462741
|
||||
AssetPath: assets/meshes/Default/Cube.fbx
|
||||
RigidBodyComponent:
|
||||
BodyType: 1
|
||||
Mass: 1
|
||||
LinearDrag: 0
|
||||
AngularDrag: 0.05
|
||||
DisableGravity: true
|
||||
IsKinematic: false
|
||||
Layer: 0
|
||||
Constraints:
|
||||
LockPositionX: false
|
||||
LockPositionY: false
|
||||
LockPositionZ: false
|
||||
LockRotationX: false
|
||||
LockRotationY: false
|
||||
LockRotationZ: false
|
||||
BoxColliderComponent:
|
||||
Offset: [0, 0, 0]
|
||||
Size: [2, 2, 2]
|
||||
IsTrigger: false
|
||||
Material: 0
|
||||
MaterialPath: ""
|
||||
- Entity: 8114736924719261351
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Camera
|
||||
TransformComponent:
|
||||
Position: [0, 0.8097433, 4.573171]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
CameraComponent:
|
||||
Camera:
|
||||
ProjectionType: 0
|
||||
PerspectiveFOV: 45
|
||||
PerspectiveNear: 0.01
|
||||
PerspectiveFar: 10000
|
||||
OrthographicSize: 10
|
||||
OrthographicNear: -1
|
||||
OrthographicFar: 1
|
||||
Primary: true
|
||||
- Entity: 9267298328378270409
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Player
|
||||
TransformComponent:
|
||||
Position: [0, 0.70693016, 0]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
ScriptComponent:
|
||||
ModuleName: FPSExample.FPSPlayer
|
||||
StoredFields:
|
||||
- Name: WalkingSpeed
|
||||
Type: 1
|
||||
Data: 2
|
||||
- Name: RunSpeed
|
||||
Type: 1
|
||||
Data: 5
|
||||
- Name: JumpForce
|
||||
Type: 1
|
||||
Data: 1
|
||||
- Name: MouseSensitivity
|
||||
Type: 1
|
||||
Data: 10
|
||||
- Name: CameraForwardOffset
|
||||
Type: 1
|
||||
Data: -2
|
||||
- Name: CameraYOffset
|
||||
Type: 1
|
||||
Data: 2
|
||||
MeshComponent:
|
||||
AssetID: 3043502408333723884
|
||||
AssetPath: assets/meshes/Default/Capsule.fbx
|
||||
RigidBodyComponent:
|
||||
BodyType: 1
|
||||
Mass: 1
|
||||
LinearDrag: 0
|
||||
AngularDrag: 0.05
|
||||
DisableGravity: false
|
||||
IsKinematic: false
|
||||
Layer: 0
|
||||
Constraints:
|
||||
LockPositionX: false
|
||||
LockPositionY: false
|
||||
LockPositionZ: false
|
||||
LockRotationX: true
|
||||
LockRotationY: false
|
||||
LockRotationZ: true
|
||||
MeshColliderComponent:
|
||||
IsConvex: true
|
||||
IsTrigger: false
|
||||
OverrideMesh: false
|
||||
Material: 0
|
||||
MaterialPath: ""
|
||||
- Entity: 10732070446010033158
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [0, -2.6466873, 0]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [100, 1, 100]
|
||||
MeshComponent:
|
||||
AssetID: 18328012085543462741
|
||||
AssetPath: assets/meshes/Default/Cube.fbx
|
||||
RigidBodyComponent:
|
||||
BodyType: 0
|
||||
Mass: 1
|
||||
LinearDrag: 0
|
||||
AngularDrag: 0.05
|
||||
DisableGravity: false
|
||||
IsKinematic: false
|
||||
Layer: 0
|
||||
Constraints:
|
||||
LockPositionX: false
|
||||
LockPositionY: false
|
||||
LockPositionZ: false
|
||||
LockRotationX: false
|
||||
LockRotationY: false
|
||||
LockRotationZ: false
|
||||
BoxColliderComponent:
|
||||
Offset: [0, 0, 0]
|
||||
Size: [2, 2, 2]
|
||||
IsTrigger: false
|
||||
Material: 0
|
||||
MaterialPath: ""
|
||||
- Entity: 5099152432245948441
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: venice_dawn_1_4k
|
||||
TransformComponent:
|
||||
Position: [0, 0, 0]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
SkyLightComponent:
|
||||
EnvironmentMap: 5211537204242875091
|
||||
EnvironmentAssetPath: assets/env/venice_dawn_1_4k.hdr
|
||||
Intensity: 1
|
||||
Angle: 0
|
||||
DynamicSky: false
|
||||
TurbidityAzimuthInclination: [2, 0, 0]
|
||||
PhysicsLayers:
|
||||
[]
|
||||
@ -1,11 +1,50 @@
|
||||
Scene: Scene Name
|
||||
Environment:
|
||||
AssetHandle: 10549690553241162923
|
||||
Light:
|
||||
Direction: [-0.314, -0.941, -0.209]
|
||||
Radiance: [0, 0, 0]
|
||||
Multiplier: 1
|
||||
AssetHandle: 6095149963749185931
|
||||
Entities:
|
||||
- Entity: 6421668200759325475
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: M1911Materials
|
||||
TransformComponent:
|
||||
Position: [0, 3.159583, 0]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
MeshComponent:
|
||||
AssetID: 7219694555758922702
|
||||
AssetPath: assets/models/m1911/M1911Materials.fbx
|
||||
- Entity: 16992665426857995732
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [0, 0, 0]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [50, 1, 50]
|
||||
MeshComponent:
|
||||
AssetID: 18328012085543462741
|
||||
AssetPath: assets/meshes/Default/Cube.fbx
|
||||
- Entity: 18182275256052989728
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Sky Light
|
||||
TransformComponent:
|
||||
Position: [0, 0, 0]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
SkyLightComponent:
|
||||
EnvironmentMap: 6095149963749185931
|
||||
EnvironmentAssetPath: ""
|
||||
Intensity: 1
|
||||
Angle: 0
|
||||
DynamicSky: true
|
||||
TurbidityAzimuthInclination: [2, 0.15, 0.71]
|
||||
- Entity: 17803125207910630398
|
||||
Parent: 0
|
||||
Children:
|
||||
@ -20,30 +59,6 @@ Entities:
|
||||
Radiance: [1, 1, 1]
|
||||
CastShadows: true
|
||||
SoftShadows: true
|
||||
LightSize: 0.5
|
||||
- Entity: 4315886439647742331
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [0, 2.048974, 0]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
MeshComponent:
|
||||
AssetID: 3580169978473467053
|
||||
- Entity: 16992665426857995732
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [0, 0, 0]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [50, 1, 50]
|
||||
MeshComponent:
|
||||
AssetID: 3580169978473467053
|
||||
LightSize: 0.9
|
||||
PhysicsLayers:
|
||||
[]
|
||||
@ -1,12 +1,21 @@
|
||||
Scene: Scene Name
|
||||
Environment:
|
||||
AssetHandle: 17073147362577408906
|
||||
Light:
|
||||
Direction: [-0.314, -0.941, -0.209]
|
||||
Radiance: [0, 0, 0]
|
||||
Multiplier: 1
|
||||
AssetHandle: 5211537204242875091
|
||||
Entities:
|
||||
- Entity: 3696833073589069488
|
||||
- Entity: 15706224176559717512
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [0, 0, 0]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
MeshComponent:
|
||||
AssetID: 18328012085543462741
|
||||
AssetPath: assets/meshes/Default/Cube.fbx
|
||||
- Entity: 8041206185299282567
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
@ -17,8 +26,11 @@ Entities:
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
SkyLightComponent:
|
||||
EnvironmentMap: 17073147362577408906
|
||||
EnvironmentMap: 5211537204242875091
|
||||
EnvironmentAssetPath: assets/env/venice_dawn_1_4k.hdr
|
||||
Intensity: 1
|
||||
Angle: 0
|
||||
DynamicSky: false
|
||||
TurbidityAzimuthInclination: [2, 0, 0]
|
||||
PhysicsLayers:
|
||||
[]
|
||||
Reference in New Issue
Block a user