공유 변수 스코프 재조정 - 이제 서브트리를 복제해서 사용하므로 그래프 단위로 조정

This commit is contained in:
김산 2025-08-29 11:53:33 +09:00
parent 3e49bb8e18
commit 2fe3bbb9ac
3 changed files with 75 additions and 122 deletions

Binary file not shown.

View File

@ -18,7 +18,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: m_Data.m_UniqueID
value: -154127738
value: -363672009
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: m_Data.m_TaskData.Array.size
@ -30,7 +30,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: m_Data.m_SharedVariableData.Array.size
value: 3
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: m_Data.m_TaskData.Array.data[0].m_Version
@ -74,8 +74,8 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: m_Data.m_SharedVariableData.Array.data[0].m_ObjectType
value: 'Opsive.GraphDesigner.Runtime.Variables.SharedVariable`1[[System.String,
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'
value: 'Opsive.GraphDesigner.Runtime.Variables.SharedVariable`1[[UnityEngine.GameObject,
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]'
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: m_Data.m_SharedVariableData.Array.data[1].m_ObjectType
@ -426,11 +426,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: m_Data.m_SharedVariableData.Array.data[0].m_Values.Array.size
value: 15
value: 29
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: m_Data.m_SharedVariableData.Array.data[1].m_Values.Array.size
value: 19
value: 29
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: m_Data.m_SharedVariableData.Array.data[2].m_Values.Array.size
@ -558,75 +558,75 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[2]'
value: 115
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[3]'
value: 116
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[4]'
value: 111
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[5]'
value: 109
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[6]'
value: 101
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[7]'
value: 114
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[3]'
value: 114
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[4]'
value: 101
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[5]'
value: 110
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[6]'
value: 116
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[7]'
value: 73
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[8]'
value: 68
value: 110
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[9]'
value: 97
value: 116
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[0]'
value: 83
value: 67
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[1]'
value: 101
value: 117
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[2]'
value: 108
value: 114
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[3]'
value: 102
value: 114
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[4]'
value: 71
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[5]'
value: 97
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[6]'
value: 109
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[7]'
value: 101
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[5]'
value: 110
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[6]'
value: 116
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[7]'
value: 73
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[8]'
value: 79
value: 110
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[9]'
value: 98
value: 116
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[2].m_Values.Array.data[0]'
@ -742,23 +742,23 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[10]'
value: 116
value: 101
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[11]'
value: 97
value: 114
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[12]'
value: 73
value: 97
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[13]'
value: 100
value: 99
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[14]'
value: 2
value: 116
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_Values.Array.data[15]'
@ -818,39 +818,39 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[10]'
value: 106
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[11]'
value: 101
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[11]'
value: 114
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[12]'
value: 99
value: 97
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[13]'
value: 116
value: 99
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[14]'
value: 2
value: 116
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[15]'
value: 255
value: 105
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[16]'
value: 255
value: 111
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[17]'
value: 255
value: 110
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[18]'
value: 255
value: 84
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_Values.Array.data[19]'
@ -1374,27 +1374,27 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_ValuePositions.Array.data[1]'
value: 14
value: 24
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_ValuePositions.Array.data[2]'
value: 14
value: 24
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_ValuePositions.Array.data[3]'
value: 15
value: 25
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_ValuePositions.Array.data[1]'
value: 14
value: 24
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_ValuePositions.Array.data[2]'
value: 14
value: 24
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_ValuePositions.Array.data[3]'
value: 15
value: 25
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[2].m_ValuePositions.Array.data[1]'
@ -1422,7 +1422,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[0].m_LongValueHashes.Array.data[3]'
value: 2962117259711222017
value: 3253260240476711
objectReference: {fileID: 0}
- target: {fileID: 3854744934792897056, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
propertyPath: 'm_Data.m_SharedVariableData.Array.data[1].m_LongValueHashes.Array.data[0]'
@ -1782,9 +1782,6 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 7462519206451630147, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
insertIndex: -1
addedObject: {fileID: 3825874317044733320}
- targetCorrespondingSourceObject: {fileID: 7462519206451630147, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
insertIndex: -1
addedObject: {fileID: -2762894235068769830}
m_SourcePrefab: {fileID: 100100000, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
--- !u!1 &4266090516809920735 stripped
GameObject:
@ -1827,41 +1824,3 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: af69e82818254bfa9cabb2dbf9430850, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &-2762894235068769830
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4266090516809920735}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0b02b4aaf7aa44843b836f6e31da7d39, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SharedVariableData:
- m_ObjectType: 'Opsive.GraphDesigner.Runtime.Variables.SharedVariable`1[[System.String,
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'
m_ValueHashes:
m_LongValueHashes: 0d00eb254f8d1b29baa620a07799d549a996976a4a64278901112428f48d1b29
m_ValuePositions: 000000000e0000000e0000000f000000
m_Values: 437573746f6d657244617461496403
m_UnityObjects: []
m_Version: 3.4
- m_ObjectType: 'Opsive.GraphDesigner.Runtime.Variables.SharedVariable`1[[UnityEngine.GameObject,
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]'
m_ValueHashes:
m_LongValueHashes: 0d00eb254f8d1b29baa620a07799d549a996976a4a64278927dafeacd28e0b00
m_ValuePositions: 000000000e0000000e0000000f000000
m_Values: 53656c6647616d654f626a65637403ffffffff
m_UnityObjects: []
m_Version: 3.4
- m_ObjectType: 'Opsive.GraphDesigner.Runtime.Variables.SharedVariable`1[[UnityEngine.GameObject,
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]'
m_ValueHashes:
m_LongValueHashes: 0d00eb254f8d1b29baa620a07799d549a996976a4a64278927dafeacd28e0b00
m_ValuePositions: 00000000180000001800000019000000
m_Values: 43757272656e74496e746572616374696f6e54617267657403ffffffff
m_UnityObjects: []
m_Version: 3.4
m_UniqueID: -846296488

View File

@ -7,36 +7,30 @@ namespace DDD
public class CustomerBlackboardComponent : MonoBehaviour, ICustomerBlackboard, IAISharedBlackboard
{
private BehaviorTree _behaviorTree;
//private GameObjectSharedVariables _sharedVariables;
public void InitializeWithBehaviorTree(BehaviorTree inBehaviorTree)
{
//_sharedVariables = GetComponent<GameObjectSharedVariables>();
_behaviorTree = inBehaviorTree;
if (!_behaviorTree) return;
//_sharedVariables.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.SelfGameObject), gameObject);
_behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.SelfGameObject), gameObject, SharedVariable.SharingScope.GameObject);
_behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.SelfGameObject), gameObject);
}
public void SetCustomerData(string inCustomerDataId)
{
if (!_behaviorTree) return;
//_sharedVariables.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.SelfGameObject), gameObject);
_behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerDataId), inCustomerDataId, SharedVariable.SharingScope.GameObject);
_behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerDataId), inCustomerDataId);
}
public void SetBlackboardGameObject(string key, GameObject inGameObject)
{
if (!_behaviorTree) return;
//_sharedVariables.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.SelfGameObject), gameObject);
_behaviorTree.SetVariableValue(key, inGameObject, SharedVariable.SharingScope.GameObject);
_behaviorTree.SetVariableValue(key, inGameObject);
}
public GameObject GetBlackboardGameObject(string key)
{
if (!_behaviorTree) return null;
//return _sharedVariables.GetVariable<GameObject>(key).Value;
return _behaviorTree.GetVariable<GameObject>(key, SharedVariable.SharingScope.GameObject)?.Value;
return _behaviorTree.GetVariable<GameObject>(key)?.Value;
}
}
}