场景相机初步,日志输出LogWindow

This commit is contained in:
SoulliesOfficial
2025-02-18 10:30:11 -05:00
parent 8d4772532f
commit b36f0469d0
31 changed files with 1497 additions and 721 deletions

File diff suppressed because one or more lines are too long

View File

@@ -50,9 +50,12 @@ MonoBehaviour:
type: 3}
inputField: {fileID: 2642348292953561022, guid: 94ed5dfb5df8c408faa267d2915aaeeb,
type: 3}
Vector3inputField: {fileID: 8936320662031972394, guid: 9e72408c17dfe4740b0e9060d6b3fafa,
vector3InputField: {fileID: 8936320662031972394, guid: 9e72408c17dfe4740b0e9060d6b3fafa,
type: 3}
parameterText: {fileID: 2642348292953561022, guid: 4b0098f7176cb49d6ac968b7d3ca4c51,
type: 3}
hintText: {fileID: 2642348292953561022, guid: 49f2af6ffb61a4145ab7ed3d0873b6a2,
type: 3}
text: {fileID: 2642348292953561022, guid: 4b0098f7176cb49d6ac968b7d3ca4c51, type: 3}
button: {fileID: 2642348292953561022, guid: 533a8f49826b0440fbdbb2a2f98738d3, type: 3}
toggle: {fileID: 2642348292953561022, guid: dfe4543fe11b54269a3bbc5b6c84e0ed, type: 3}
enumDropdown: {fileID: 2642348292953561022, guid: 51df578950a6d4a35a922e00753efb58,

View File

@@ -0,0 +1,324 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2522200636602697985
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4815310443098260762}
- component: {fileID: 8863047526699937627}
- component: {fileID: 4146383444293307128}
m_Layer: 5
m_Name: Title
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4815310443098260762
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2522200636602697985}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2546924885880613247}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 32.5}
m_SizeDelta: {x: 200, y: 35}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8863047526699937627
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2522200636602697985}
m_CullTransparentMesh: 1
--- !u!114 &4146383444293307128
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2522200636602697985}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Title
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 18
m_fontSizeBase: 18
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &2642348292953561022
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2546924885880613247}
- component: {fileID: 2388560450800572769}
m_Layer: 5
m_Name: HintText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2546924885880613247
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2642348292953561022}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4815310443098260762}
- {fileID: 8314584144366428067}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 240, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2388560450800572769
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2642348292953561022}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e581b946f0ff64cccafda0d2e8d76681, type: 3}
m_Name:
m_EditorClassIdentifier:
title: {fileID: 4146383444293307128}
parameterName:
isAlwaysUpdated: 0
text: {fileID: 1511802765271541473}
--- !u!1 &4303436613740383453
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8314584144366428067}
- component: {fileID: 8091948658150366110}
- component: {fileID: 1511802765271541473}
m_Layer: 5
m_Name: TextContent
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8314584144366428067
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4303436613740383453}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2546924885880613247}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0.0000076293945, y: -17.5}
m_SizeDelta: {x: 220, y: 65}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8091948658150366110
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4303436613740383453}
m_CullTransparentMesh: 1
--- !u!114 &1511802765271541473
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4303436613740383453}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: (1,2,3,4)
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 15
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 15
m_fontSizeMax: 36
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 49f2af6ffb61a4145ab7ed3d0873b6a2
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -145,7 +145,7 @@ GameObject:
- component: {fileID: 2546924885880613247}
- component: {fileID: 1590546503192305588}
m_Layer: 5
m_Name: Text
m_Name: ParameterText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c7200eb7314c642b596a3075e48312e4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,150 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &591399213823941727
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 534775924950268970}
- component: {fileID: 8183404397726464440}
- component: {fileID: 7734858737857034854}
- component: {fileID: 1518651257440837964}
m_Layer: 5
m_Name: LogText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &534775924950268970
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591399213823941727}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 450, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8183404397726464440
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591399213823941727}
m_CullTransparentMesh: 1
--- !u!114 &7734858737857034854
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591399213823941727}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: New Text
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 17.9
m_fontSizeBase: 18
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 8
m_fontSizeMax: 18
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &1518651257440837964
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591399213823941727}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c627b09eb0f984c59b55367c47919d38, type: 3}
m_Name:
m_EditorClassIdentifier:
logText: {fileID: 7734858737857034854}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1802da913767140929fbb149d8bb1bf5
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,9 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame;
using TMPro;
using UniRx;
using UnityEngine;
namespace Ichni.Editor
@@ -14,5 +16,10 @@ namespace Ichni.Editor
{
text.text = content;
}
public void SetUpdatingContent(Func<string> content)
{
Observable.EveryUpdate().Subscribe(_ => text.text = content()).AddTo(gameObject);
}
}
}

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using Ichni.RhythmGame;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
namespace Ichni.Editor
{
@@ -36,5 +37,10 @@ namespace Ichni.Editor
}
connectedBaseElement.Refresh();
}
public void AddListenerFunction(UnityAction<string> action)
{
inputField.onEndEdit.AddListener(action);
}
}
}

View File

@@ -14,7 +14,6 @@ namespace Ichni.Editor
public GameElement connectedGameElement;
public HierarchyTab parentTab;
public List<HierarchyTab> childTabList;
public List<int> IDqueue;
public int tabLayer;
public bool isSelected;
@@ -30,7 +29,6 @@ namespace Ichni.Editor
public void SetTab(GameElement targetElement, GameElement parentElement)
{
connectedGameElement = targetElement;
tabButtonText.text = targetElement.elementName;
targetElement.connectedTab = this;
@@ -49,12 +47,8 @@ namespace Ichni.Editor
this.parentTab = parentElement.connectedTab;
parentElement.connectedTab.childTabList.Add(this);
this.tabLayer = this.parentTab.tabLayer + 1;
this.transform.SetSiblingIndex(this.parentTab.transform.GetSiblingIndex() +
this.parentTab.connectedGameElement.childElementList.Count);
this.transform.SetSiblingIndex(this.parentTab.transform.GetSiblingIndex() + GetAllChildrenCount(this.parentTab));
if (!this.parentTab.isExpanded)
{
this.isExpanded = false;
@@ -63,7 +57,7 @@ namespace Ichni.Editor
for (int i = 1; i <= this.tabLayer; i++)
{
float lineX = 30 * i;
float lineX = 30 * i - 10;
Instantiate(indentationLinePrefab, tabRect).GetComponent<RectTransform>().anchoredPosition = new Vector2(lineX, 0);
}
}
@@ -71,7 +65,6 @@ namespace Ichni.Editor
float posX = -25 +( 30 * tabLayer);
tabMainRect.anchoredPosition = new Vector2(posX, tabMainRect.anchoredPosition.y);
tabButton.onClick.AddListener(SelectGameElement);
expandButton.onClick.AddListener(ExpandOrFold);
}
@@ -104,10 +97,11 @@ namespace Ichni.Editor
if (isExpanded)
{
expandButton.transform.Rotate(new Vector3(0, 0, 180));
foreach (GameElement i in connectedGameElement.childElementList)
for (var index = 0; index < connectedGameElement.childElementList.Count; index++)
{
HierarchyTab a = EditorManager.instance.uiManager.hierarchy.GenerateTab(i, connectedGameElement);
childTabList.Add(a);
var childElement = connectedGameElement.childElementList[index];
EditorManager.instance.uiManager.hierarchy.GenerateTab(childElement, connectedGameElement);
}
}
else

View File

@@ -101,7 +101,7 @@ namespace Ichni.Editor
string title, string parameterName)
{
DynamicUIVector3InputField vector3InputField =
Instantiate(EditorManager.instance.basePrefabs.Vector3inputField, container.rect)
Instantiate(EditorManager.instance.basePrefabs.vector3InputField, container.rect)
.GetComponent<DynamicUIVector3InputField>();
vector3InputField.Initialize(baseElement, title, parameterName);
container.dynamicUIElements.Add(vector3InputField);
@@ -128,20 +128,30 @@ namespace Ichni.Editor
return colorPicker;
}
public DynamicUIHintText GenerateText(IBaseElement baseElement, DynamicUIContainer container, string content)
public DynamicUIHintText GenerateHintText(IBaseElement baseElement, DynamicUIContainer container, string content)
{
DynamicUIHintText parameterText = Instantiate(EditorManager.instance.basePrefabs.text, container.rect)
DynamicUIHintText hintText = Instantiate(EditorManager.instance.basePrefabs.hintText, container.rect)
.GetComponent<DynamicUIHintText>();
parameterText.Initialize(baseElement, string.Empty, string.Empty);
parameterText.SetContent(content);
container.dynamicUIElements.Add(parameterText);
return parameterText;
hintText.Initialize(baseElement, string.Empty, string.Empty);
hintText.SetContent(content);
container.dynamicUIElements.Add(hintText);
return hintText;
}
public DynamicUIHintText GenerateHintText(IBaseElement baseElement, DynamicUIContainer container, Func<string> action)
{
DynamicUIHintText hintText = Instantiate(EditorManager.instance.basePrefabs.hintText, container.rect)
.GetComponent<DynamicUIHintText>();
hintText.Initialize(baseElement, string.Empty, string.Empty);
hintText.SetUpdatingContent(action);
container.dynamicUIElements.Add(hintText);
return hintText;
}
public DynamicUIParameterText GenerateText(IBaseElement baseElement, DynamicUIContainer container, string title,
public DynamicUIParameterText GenerateParameterText(IBaseElement baseElement, DynamicUIContainer container, string title,
string parameterName, bool isAlwaysUpdate = false)
{
DynamicUIParameterText parameterText = Instantiate(EditorManager.instance.basePrefabs.text, container.rect)
DynamicUIParameterText parameterText = Instantiate(EditorManager.instance.basePrefabs.parameterText, container.rect)
.GetComponent<DynamicUIParameterText>();
parameterText.Initialize(baseElement, title, parameterName);
parameterText.isAlwaysUpdated = isAlwaysUpdate;

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d563adb990452433e8dd44155e6e4d33
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
using TMPro;
using UnityEngine;
namespace Ichni.Editor
{
public class LogText : MonoBehaviour
{
public TMP_Text logText;
public void SetLogText(string text, Color color)
{
logText.text = text;
logText.color = color;
string logFilePath = EditorManager.instance.projectInformation.projectPath + "/Logs/EditorLog.txt";
// if(!ES3.FileExists(logFilePath)) System.IO.File.Create(logFilePath).Dispose();
//
// System.IO.File.AppendAllText(logFilePath, text + "\n");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c627b09eb0f984c59b55367c47919d38
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
using UnityEngine;
namespace Ichni.Editor
{
public class LogWindow : MonoBehaviour
{
public GameObject logTextPrefab;
public RectTransform textRect;
public Queue<LogText> logTexts;
public int logTextCapacity = 4;
private void Start()
{
logTexts = new Queue<LogText>();
}
public void AddLog(string text, Color color = default)
{
CheckLogTextCapacity();
LogText logText = LeanPool.Spawn(logTextPrefab, textRect).GetComponent<LogText>();
if (color == default) color = Color.white;
logText.SetLogText(text, color);
logTexts.Enqueue(logText);
}
private void CheckLogTextCapacity()
{
if (logTexts.Count >= logTextCapacity)
{
LeanPool.Despawn(logTexts.Dequeue().gameObject);
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d537bd381617a4941839f44c04840c28
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -9,5 +9,6 @@ namespace Ichni.Editor
public Canvas mainCanvas;
public ToolBar toolBar;
public ResolutionHints resolutionHints;
public LogWindow logWindow;
}
}

View File

@@ -17,7 +17,10 @@ namespace Ichni.RhythmGame
/// <summary>
/// 用于生成存档
/// </summary>
public void SaveBM();
public void SaveBM()
{
}
/// <summary>
/// 刷新物体的状态
@@ -44,7 +47,11 @@ namespace Ichni.RhythmGame
}
public Inspector inspector => EditorManager.instance.uiManager.inspector;
public void SetUpInspector();
public void SetUpInspector()
{
}
}
// public virtual void SetTimeDuration()

View File

@@ -93,11 +93,11 @@ namespace Ichni.RhythmGame
var originalScaleInputField =
inspector.GenerateVec3InputField(this, container, "Start Scale", nameof(originalScale));
var currentPosText =
inspector.GenerateText(this, container, "Current Position", nameof(currentPosition), true);
inspector.GenerateParameterText(this, container, "Current Position", nameof(currentPosition), true);
var currentRotText =
inspector.GenerateText(this, container, "Current Rotation", nameof(currentEulerAngles), true);
inspector.GenerateParameterText(this, container, "Current Rotation", nameof(currentEulerAngles), true);
var currentScaleText =
inspector.GenerateText(this, container, "Current Scale", nameof(currentScale), true);
inspector.GenerateParameterText(this, container, "Current Scale", nameof(currentScale), true);
}
public override void Refresh()

View File

@@ -149,7 +149,7 @@ namespace Ichni.RhythmGame
{
var container = inspector.GenerateContainer("Element Info");
var nameInputField = inspector.GenerateInputField(this, container, GetType().Name + "'s Name", nameof(elementName));
var guidText = inspector.GenerateText(this, container, "Element GUID", nameof(elementGuid));
var guidText = inspector.GenerateParameterText(this, container, "Element GUID", nameof(elementGuid));
var tagsListButton = inspector.GenerateButton(this, container, "Tags List", () =>
{
inspector.GenerateCompositeParameterWindow(this, "Tags List", nameof(tags)).SetAsStringList();

View File

@@ -79,6 +79,14 @@ namespace Ichni.RhythmGame
{
matchedBM = new Beatmap.PathNode_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM);
}
public override void SetUpInspector()
{
base.SetUpInspector();
var container = inspector.GenerateContainer("Path Node");
var indexText = inspector.GenerateHintText(this, container, "Index: " + index);
}
}
namespace Beatmap

View File

@@ -33,11 +33,12 @@ public class BasePrefabsCollection : SerializedScriptableObject
[Title("DynamicUI相关-Simple")] public GameObject dynamicUIContainer;
public GameObject inputField;
public GameObject Vector3inputField;
public GameObject text;
[FormerlySerializedAs("Vector3inputField")] public GameObject vector3InputField;
[FormerlySerializedAs("text")] public GameObject parameterText;
public GameObject hintText;
public GameObject button;
public GameObject toggle;
[FormerlySerializedAs("dropdown")] public GameObject enumDropdown;
public GameObject enumDropdown;
public GameObject stringListDropdown;
public GameObject baseColorPicker;
public GameObject emissionColorPicker;

View File

@@ -0,0 +1,42 @@
using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame;
using Ichni.RhythmGame.Beatmap;
using UnityEngine;
namespace Ichni.Editor
{
public class CameraManager : MonoBehaviour, IBaseElement
{
public bool isSceneCameraActive;
public SceneCamera sceneCamera;
public float cameraMoveSpeed;
public GameCamera gameCamera;
private bool haveGameCamera => gameCamera != null;
public BaseElement_BM matchedBM { get; set; }
public void SwitchCamera()
{
if (!haveGameCamera)
{
throw new System.Exception("GameCamera is not assigned");
}
isSceneCameraActive = !isSceneCameraActive;
sceneCamera.camera.enabled = isSceneCameraActive;
gameCamera.camera.enabled = !isSceneCameraActive;
}
public void SetUpInspector()
{
string ShowCameraType() => isSceneCameraActive ? "Scene Camera" : "Game Camera";
var container = EditorManager.instance.uiManager.inspector.GenerateContainer("Camera Manager");
var cameraTypeText = EditorManager.instance.uiManager.inspector.GenerateHintText(this, container, ShowCameraType);
var switchCameraButton = EditorManager.instance.uiManager.inspector.GenerateButton(this, container, "Switch Camera", SwitchCamera);
var cameraMoveSpeedField = EditorManager.instance.uiManager.inspector.GenerateInputField(this, container, "Camera Move Speed", nameof(cameraMoveSpeed));
sceneCamera.SetUpInspector();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 604e2c80e1fb64c2ba9608c11fb2f040
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -7,6 +7,7 @@ using Ichni.RhythmGame.Beatmap;
using Ichni.RhythmGame.ThemeBundles.Basic;
using Sirenix.OdinInspector;
using UnityEngine;
using Random = UnityEngine.Random;
namespace Ichni
{
@@ -18,6 +19,7 @@ namespace Ichni
public EditorUIManager uiManager;
public EditorSettings editorSettings;
public BackgroundController backgroundController;
public CameraManager cameraManager;
public ProjectInformation projectInformation;
public SongInformation songInformation;
@@ -75,6 +77,7 @@ namespace Ichni
"basic", "Skybox", "Background"));
projectInformation.SetUpInspector();
songInformation.SetUpInspector();
cameraManager.SetUpInspector();
}
private void CreateNew()

View File

@@ -10,6 +10,37 @@ namespace Ichni.Editor
{
private void Update()
{
if (EditorManager.instance.cameraManager.isSceneCameraActive)
{
float cameraSpeed = EditorManager.instance.cameraManager.cameraMoveSpeed * Time.deltaTime;
Transform sceneCameraTransform = EditorManager.instance.cameraManager.sceneCamera.transform;
if (Keyboard.current.wKey.isPressed)
{
sceneCameraTransform.position += sceneCameraTransform.forward * cameraSpeed;
}
if (Keyboard.current.sKey.isPressed)
{
sceneCameraTransform.position -= sceneCameraTransform.forward * cameraSpeed;
}
if (Keyboard.current.dKey.isPressed)
{
sceneCameraTransform.position += sceneCameraTransform.right * cameraSpeed;
}
if (Keyboard.current.aKey.isPressed)
{
sceneCameraTransform.position -= sceneCameraTransform.right * cameraSpeed;
}
if (Keyboard.current.spaceKey.isPressed)
{
sceneCameraTransform.position += sceneCameraTransform.up * cameraSpeed;
}
if (Keyboard.current.leftShiftKey.isPressed)
{
sceneCameraTransform.position -= sceneCameraTransform.up * cameraSpeed;
}
}
if (Keyboard.current.leftCtrlKey.isPressed)
{
if (Keyboard.current.sKey.wasPressedThisFrame)
@@ -20,7 +51,9 @@ namespace Ichni.Editor
{
EditorManager.instance.projectManager.exportManager.Export();
}
else if (Keyboard.current.digit1Key.wasPressedThisFrame)
if (Keyboard.current.digit1Key.wasPressedThisFrame)
{
EditorManager.instance.uiManager.mainPage.resolutionHints.SetPhoneFrame();
}

View File

@@ -0,0 +1,54 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame;
using Ichni.RhythmGame.Beatmap;
using UnityEngine;
namespace Ichni.Editor
{
public class SceneCamera : MonoBehaviour, IBaseElement
{
public Camera camera;
public GameCamera.CameraViewType viewType;
public float perspectiveAngle;
public float orthographicSize;
public BaseElement_BM matchedBM { get; set; }
public void SetUpInspector()
{
Inspector inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Scene Camera");
var viewTypeDropdown = inspector.GenerateDropdown(this, container, "View Type", typeof(GameCamera.CameraViewType), nameof(viewType));
var perspectiveAngleField = inspector.GenerateInputField(this, container, "Perspective Angle", nameof(perspectiveAngle));
var orthographicSizeField = inspector.GenerateInputField(this, container, "Orthographic Size", nameof(orthographicSize));
viewTypeDropdown.AddListenerFunction(_ =>
{
camera.orthographic = viewType == GameCamera.CameraViewType.Orthographic;
});
perspectiveAngleField.AddListenerFunction(_ =>
{
camera.fieldOfView = perspectiveAngle;
});
orthographicSizeField.AddListenerFunction(_ =>
{
camera.orthographicSize = orthographicSize;
});
string GetPosition() => $"Position: {camera.transform.position}";
var positionText = inspector.GenerateHintText(this, container, GetPosition);
string GetEulerAngles() => $"Euler Angles: {camera.transform.eulerAngles}";
var eulerAnglesText = inspector.GenerateHintText(this, container, GetEulerAngles);
}
public void MoveCamera(Vector3 delta)
{
camera.transform.position += delta;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 63e7ac45befe54908ba6c691211fcbfa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: