basePrefab RootObject 추가

This commit is contained in:
NTG_Lenovo 2025-08-06 15:25:30 +09:00
parent e1173db758
commit a0e1da1115
9 changed files with 168 additions and 64 deletions

View File

@ -1,5 +1,37 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1 &1063320636771556828
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4989806232884897458}
m_Layer: 0
m_Name: RootObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4989806232884897458
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1063320636771556828}
serializedVersion: 2
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: 1
m_Children:
- {fileID: 9180751142906097830}
m_Father: {fileID: 7109183892527308107}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1241020487330251412 --- !u!1 &1241020487330251412
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -26,12 +58,12 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1241020487330251412} m_GameObject: {fileID: 1241020487330251412}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927} m_LocalRotation: {x: 0.3420201, y: -0, z: -0, w: 0.9396927}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 7109183892527308107} m_Father: {fileID: 4989806232884897458}
m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0}
--- !u!33 &193570259864000515 --- !u!33 &193570259864000515
MeshFilter: MeshFilter:
@ -116,7 +148,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 9180751142906097830} - {fileID: 4989806232884897458}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &721650953543496402 --- !u!65 &721650953543496402

View File

@ -25,12 +25,12 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2657423305549939101} m_GameObject: {fileID: 2657423305549939101}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927} m_LocalRotation: {x: 0.3420201, y: -0, z: -0, w: 0.9396927}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 2084900895006646920} m_Father: {fileID: 1214691911864137639}
m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0}
--- !u!212 &3463077198689503016 --- !u!212 &3463077198689503016
SpriteRenderer: SpriteRenderer:
@ -87,6 +87,38 @@ SpriteRenderer:
m_WasSpriteAssigned: 1 m_WasSpriteAssigned: 1
m_MaskInteraction: 0 m_MaskInteraction: 0
m_SpriteSortPoint: 0 m_SpriteSortPoint: 0
--- !u!1 &2772427910910111872
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1214691911864137639}
m_Layer: 0
m_Name: RootObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1214691911864137639
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2772427910910111872}
serializedVersion: 2
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: 1
m_Children:
- {fileID: 6187678082237817855}
m_Father: {fileID: 2084900895006646920}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &6022500804847150892 --- !u!1 &6022500804847150892
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -116,6 +148,6 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 6187678082237817855} - {fileID: 1214691911864137639}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -1,5 +1,37 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1 &2034852835707859355
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4743765396046854981}
m_Layer: 0
m_Name: RootObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4743765396046854981
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2034852835707859355}
serializedVersion: 2
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: 1
m_Children:
- {fileID: 6187678082237817855}
m_Father: {fileID: 2084900895006646920}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2657423305549939101 --- !u!1 &2657423305549939101
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -25,12 +57,12 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2657423305549939101} m_GameObject: {fileID: 2657423305549939101}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927} m_LocalRotation: {x: 0.3420201, y: -0, z: -0, w: 0.9396927}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 2084900895006646920} m_Father: {fileID: 4743765396046854981}
m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0}
--- !u!212 &3463077198689503016 --- !u!212 &3463077198689503016
SpriteRenderer: SpriteRenderer:
@ -116,6 +148,6 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 6187678082237817855} - {fileID: 4743765396046854981}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -31,7 +31,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 3821081434711279172} m_Father: {fileID: 7511707580127947132}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &4837437381441246234 --- !u!108 &4837437381441246234
Light: Light:
@ -147,12 +147,12 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6964515026568296306} m_GameObject: {fileID: 6964515026568296306}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.42261827, y: 0, z: 0, w: 0.9063079} m_LocalRotation: {x: 0.42261827, y: -0, z: -0, w: 0.9063079}
m_LocalPosition: {x: 0, y: 2.009, z: -0.507} m_LocalPosition: {x: 0, y: 2.009, z: -0.507}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 3821081434711279172} m_Father: {fileID: 7511707580127947132}
m_LocalEulerAnglesHint: {x: 50, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 50, y: 0, z: 0}
--- !u!108 &4277184008289255055 --- !u!108 &4277184008289255055
Light: Light:
@ -327,10 +327,10 @@ PrefabInstance:
- {fileID: 127430239903465757, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - {fileID: 127430239903465757, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - targetCorrespondingSourceObject: {fileID: 4993183601549197863, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 92685501732061756} addedObject: {fileID: 92685501732061756}
- targetCorrespondingSourceObject: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - targetCorrespondingSourceObject: {fileID: 4993183601549197863, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 7476222657412110048} addedObject: {fileID: 7476222657412110048}
m_AddedComponents: m_AddedComponents:
@ -347,11 +347,6 @@ PrefabInstance:
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 1115647804376030753} addedObject: {fileID: 1115647804376030753}
m_SourcePrefab: {fileID: 100100000, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
--- !u!4 &3821081434711279172 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
m_PrefabInstance: {fileID: 3275709266858077019}
m_PrefabAsset: {fileID: 0}
--- !u!1 &7316134055819320434 stripped --- !u!1 &7316134055819320434 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} m_CorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
@ -413,3 +408,8 @@ MonoBehaviour:
_isRandomRange: 0 _isRandomRange: 0
_randomRange: {x: 0, y: 0} _randomRange: {x: 0, y: 0}
_randomStrings: [] _randomStrings: []
--- !u!4 &7511707580127947132 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4993183601549197863, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
m_PrefabInstance: {fileID: 3275709266858077019}
m_PrefabAsset: {fileID: 0}

View File

@ -1,5 +1,37 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1 &2182479135931305606
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4993183601549197863}
m_Layer: 0
m_Name: RootObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4993183601549197863
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2182479135931305606}
serializedVersion: 2
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: 1
m_Children:
- {fileID: 1111036208394089843}
m_Father: {fileID: 1761643478070701343}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5259510642736920361 --- !u!1 &5259510642736920361
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -35,7 +67,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 1111036208394089843} - {fileID: 4993183601549197863}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!54 &5176902543201676162 --- !u!54 &5176902543201676162
@ -134,6 +166,17 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c9a5f5b2cb6745238a931b4d52f5d57a, type: 3} m_Script: {fileID: 11500000, guid: c9a5f5b2cb6745238a931b4d52f5d57a, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_nearColliders:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
--- !u!1 &6791841979869644848 --- !u!1 &6791841979869644848
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -161,12 +204,12 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6791841979869644848} m_GameObject: {fileID: 6791841979869644848}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927} m_LocalRotation: {x: 0.3420201, y: -0, z: -0, w: 0.9396927}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 1761643478070701343} m_Father: {fileID: 4993183601549197863}
m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0}
--- !u!33 &5817391387681993290 --- !u!33 &5817391387681993290
MeshFilter: MeshFilter:

View File

@ -279,46 +279,6 @@ public static void CreateSingleAtlas(string path, string destPath)
}; };
} }
public static void CreatePrefab(string path, string destPath)
{
try
{
var spriteCreateComponents = new List<IPostProcessorSpriteAtlas>();
spriteCreateComponents.CreateInstanceList();
var sprite = AssetDatabase.LoadAssetAtPath<Sprite>(path);
if (sprite == null) return;
GameObject prefab = new GameObject(sprite.name);
prefab.transform.localPosition = Vector3.zero;
prefab.transform.localRotation = Quaternion.identity;
prefab.name = sprite.name;
GameObject visualLook = new GameObject(CommonConstants.VisualLook);
visualLook.transform.SetParent(prefab.transform);
visualLook.transform.localPosition = Vector3.zero;
visualLook.transform.localRotation = Quaternion.Euler(new Vector3(40f, 0f, 0f));
SpriteRenderer spriteRenderer = visualLook.AddComponent<SpriteRenderer>();
spriteRenderer.sprite = sprite;
spriteRenderer.sortingOrder = 5;
Utils.MakeFolderFromFilePath(destPath);
AssetDatabase.DeleteAsset(destPath);
var newPrefab =
PrefabUtility.SaveAsPrefabAssetAndConnect(prefab, destPath, InteractionMode.AutomatedAction);
Object.DestroyImmediate(prefab, false);
Debug.Log("Build : " + destPath, newPrefab);
}
catch (System.Exception e)
{
Debug.LogError("Cant build " + destPath + "\n" + e);
}
}
public static void BuildTarget() public static void BuildTarget()
{ {
foreach (var path in TargetPaths) foreach (var path in TargetPaths)

View File

@ -6,13 +6,15 @@ public class RestaurantPlayerCharacter : RestaurantCharacter
{ {
private RestaurantPlayerMovement _movement; private RestaurantPlayerMovement _movement;
private Transform _rootObject;
private Transform _visualLook; private Transform _visualLook;
private void Awake() private void Awake()
{ {
_movement = GetComponent<RestaurantPlayerMovement>(); _movement = GetComponent<RestaurantPlayerMovement>();
_visualLook = transform.Find(CommonConstants.VisualLook); _rootObject = transform.Find(CommonConstants.RootObject);
_visualLook = _rootObject.Find(CommonConstants.VisualLook);
} }
private void Update() private void Update()

View File

@ -9,6 +9,7 @@ public class RestaurantEnvironment : MonoBehaviour
private RestaurantEnvironmentData _restaurantEnvironmentData; private RestaurantEnvironmentData _restaurantEnvironmentData;
private Collider _collider; private Collider _collider;
private Transform _rootObject;
private Transform _visualLook; private Transform _visualLook;
private Renderer _renderer; private Renderer _renderer;
@ -17,7 +18,8 @@ public async void Initialize(RestaurantEnvironmentData data)
EnvironmentData environmentData = DataManager.Instance.GetDataSo<EnvironmentDataSo>().GetDataById(data.Id); EnvironmentData environmentData = DataManager.Instance.GetDataSo<EnvironmentDataSo>().GetDataById(data.Id);
_collider = GetComponent<Collider>(); _collider = GetComponent<Collider>();
_visualLook = transform.Find(CommonConstants.VisualLook); _rootObject = transform.Find(CommonConstants.RootObject);
_visualLook = _rootObject.Find(CommonConstants.VisualLook);
if (environmentData == null) if (environmentData == null)
{ {

View File

@ -2,6 +2,7 @@ namespace DDD
{ {
public static class CommonConstants public static class CommonConstants
{ {
public const string RootObject = "RootObject";
public const string VisualLook = "VisualLook"; public const string VisualLook = "VisualLook";
public const string RestaurantPlayer = "RestaurantPlayer"; public const string RestaurantPlayer = "RestaurantPlayer";
public const string BaseRestaurantEnvironment = "BaseRestaurantEnvironment"; public const string BaseRestaurantEnvironment = "BaseRestaurantEnvironment";