work in progress
This commit is contained in:
parent
2a3c2839d5
commit
c2d8c78028
51 changed files with 787 additions and 131 deletions
|
@ -32,6 +32,30 @@ AnimatorController:
|
|||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
- m_Name: Acknowledging
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
- m_Name: Handshake
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
- m_Name: Interacting
|
||||
m_Type: 4
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
- m_Name: Bow
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
|
@ -107,6 +131,48 @@ AnimatorStateTransition:
|
|||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101135810287238254
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 1102150790202348572}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101135981261825622
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 1102150790202348572}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101154328280627494
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
|
@ -131,9 +197,33 @@ AnimatorStateTransition:
|
|||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101181216926135622
|
||||
--- !u!1101 &1101160161055095008
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 3
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Bow
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 1102165061342770366}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.97
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101170121935933728
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
|
@ -149,7 +239,31 @@ AnimatorStateTransition:
|
|||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.70000005
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101181216926135622
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 3
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Interacting
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 1102150790202348572}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.99980146
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
|
@ -210,6 +324,9 @@ AnimatorStateTransition:
|
|||
- m_ConditionMode: 3
|
||||
m_ConditionEvent: MoveSpeed
|
||||
m_EventTreshold: 0.1
|
||||
- m_ConditionMode: 2
|
||||
m_ConditionEvent: Interacting
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 1102075779692729400}
|
||||
m_Solo: 0
|
||||
|
@ -224,6 +341,30 @@ AnimatorStateTransition:
|
|||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101256581112365290
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Interrupted
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 1102150790202348572}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101324464263039550
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
|
@ -248,6 +389,30 @@ AnimatorStateTransition:
|
|||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101338341885882894
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Acknowledging
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 1102931569936446222}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.97
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101398582299456848
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
|
@ -293,6 +458,75 @@ AnimatorStateTransition:
|
|||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101409095834488426
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 1102150790202348572}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101520524675126252
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Interrupted
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 1102150790202348572}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101541003412757350
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Handshake
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 1102238894748598768}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.97
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101775513785162602
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 3
|
||||
|
@ -317,6 +551,27 @@ AnimatorStateTransition:
|
|||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101792283228765850
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 1102238894748598768}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.97
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1101864097741464978
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
|
@ -380,6 +635,9 @@ AnimatorState:
|
|||
- {fileID: 1101154328280627494}
|
||||
- {fileID: 1101234958992700582}
|
||||
- {fileID: 1101864097741464978}
|
||||
- {fileID: 1101338341885882894}
|
||||
- {fileID: 1101541003412757350}
|
||||
- {fileID: 1101160161055095008}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
|
@ -393,6 +651,56 @@ AnimatorState:
|
|||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
--- !u!1102 &1102165061342770366
|
||||
AnimatorState:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Bow
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: 1101135981261825622}
|
||||
- {fileID: 1101520524675126252}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_Motion: {fileID: 7400000, guid: 6163c5b3aa64c9b43b5c93025af82a2d, type: 3}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
--- !u!1102 &1102238894748598768
|
||||
AnimatorState:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Handshake
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: 1101170121935933728}
|
||||
- {fileID: 1101409095834488426}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_Motion: {fileID: 7400000, guid: 5e3641c477eb0f94f997258674c78d7a, type: 3}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
--- !u!1102 &1102575800090953688
|
||||
AnimatorState:
|
||||
serializedVersion: 5
|
||||
|
@ -443,6 +751,31 @@ AnimatorState:
|
|||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
--- !u!1102 &1102931569936446222
|
||||
AnimatorState:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Acknowledging
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: 1101256581112365290}
|
||||
- {fileID: 1101135810287238254}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_Motion: {fileID: 7400000, guid: 7bbded55674598e4eba78dfa92ea2881, type: 3}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
--- !u!1107 &1107952132972436046
|
||||
AnimatorStateMachine:
|
||||
serializedVersion: 5
|
||||
|
@ -462,7 +795,16 @@ AnimatorStateMachine:
|
|||
m_Position: {x: 348, y: 120, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 1102575800090953688}
|
||||
m_Position: {x: 588, y: 12, z: 0}
|
||||
m_Position: {x: 348, y: -132, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 1102931569936446222}
|
||||
m_Position: {x: 348, y: -60, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 1102238894748598768}
|
||||
m_Position: {x: 348, y: -204, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 1102165061342770366}
|
||||
m_Position: {x: 348, y: -276, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
|
|
|
@ -2153,9 +2153,10 @@ MonoBehaviour:
|
|||
_isInteracting: 0
|
||||
interactions:
|
||||
- {fileID: 11400000, guid: 01a3cf8545fc70f4c90095f144ac9b01, type: 2}
|
||||
- {fileID: 11400000, guid: 7fc2c5ab600b7b64c832a95abea9589f, type: 2}
|
||||
- {fileID: 11400000, guid: 80ca1bec2c07531428cf5a84624e44a4, type: 2}
|
||||
spyInteractions:
|
||||
- {fileID: 11400000, guid: 218e2ddac8223e349a855bdae23819ab, type: 2}
|
||||
GlowColor: {r: 0, g: 1, b: 0, a: 0}
|
||||
currentState: {fileID: 11400000, guid: 78ec31c429ad5074bb50d001b1a49a77, type: 2}
|
||||
remainState: {fileID: 0}
|
||||
navMeshAgent: {fileID: 0}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: acbb53bdc7aa18d45a61fd8bac4ed071, type: 3}
|
||||
m_Name: NpcInteract
|
||||
m_EditorClassIdentifier:
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 53ec3cb6384716d429b45c03bbf8ff18
|
||||
timeCreated: 1507585684
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,13 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 73193a69302e61643a42134080a61e99, type: 3}
|
||||
m_Name: NpcWaitForInteractionAcceptanceAction
|
||||
m_EditorClassIdentifier:
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8b6c25cdef34b7b408b0d79d1ce4d7c3
|
||||
timeCreated: 1507587807
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,13 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 857349843f32b194e9bf5d2fe22ca2fc, type: 3}
|
||||
m_Name: SelectedObject
|
||||
m_EditorClassIdentifier:
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c14d2053399388247b9cfde51ce5f57c
|
||||
timeCreated: 1507585044
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,13 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5998aa6b572affe4a98a2e05c3ad4f0b, type: 3}
|
||||
m_Name: ReceivingInteraction
|
||||
m_EditorClassIdentifier:
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 010846579b426744d84ebd4f5f2ce837
|
||||
timeCreated: 1507590202
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -9,7 +9,5 @@ MonoBehaviour:
|
|||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a3d87936679da304bb792186a3b641cd, type: 3}
|
||||
m_Name: PassingMessageToIdleTransition
|
||||
m_Name: WaitForTransition
|
||||
m_EditorClassIdentifier:
|
||||
fromState: PassingMessage
|
||||
toState: Idle
|
|
@ -0,0 +1,21 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3e84829fa9f855a42b9c35f7eb3b3dc0, type: 3}
|
||||
m_Name: Bow
|
||||
m_EditorClassIdentifier:
|
||||
interactionDescription: bow
|
||||
receiverDescription: receive bow
|
||||
initiatorAnimationTrigger: 8
|
||||
objectAnimationTrigger: 8
|
||||
result: 0
|
||||
initialRotation: 0
|
||||
objectInitialRotation: 0
|
||||
interactionDistance: 1.2
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 80ca1bec2c07531428cf5a84624e44a4
|
||||
timeCreated: 1507577166
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,21 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3e84829fa9f855a42b9c35f7eb3b3dc0, type: 3}
|
||||
m_Name: Handshake
|
||||
m_EditorClassIdentifier:
|
||||
interactionDescription: handshake
|
||||
receiverDescription: receive handshake
|
||||
initiatorAnimationTrigger: 6
|
||||
objectAnimationTrigger: 6
|
||||
result: 0
|
||||
initialRotation: 0
|
||||
objectInitialRotation: 0
|
||||
interactionDistance: 1.2
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7fc2c5ab600b7b64c832a95abea9589f
|
||||
timeCreated: 1507575502
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -13,7 +13,8 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
interactionDescription: tell a secret
|
||||
receiverDescription: listen to a secret
|
||||
characterInteraction: 2
|
||||
initiatorAnimationTrigger: 2
|
||||
objectAnimationTrigger: 2
|
||||
result: 1
|
||||
initialRotation: -60
|
||||
objectInitialRotation: -60
|
||||
|
|
|
@ -13,7 +13,8 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
interactionDescription: wave
|
||||
receiverDescription: wave back
|
||||
characterInteraction: 4
|
||||
initiatorAnimationTrigger: 4
|
||||
objectAnimationTrigger: 4
|
||||
result: 0
|
||||
initialRotation: 0
|
||||
objectInitialRotation: 0
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5a6a367e35acd7e44a0a598eaa1d6700, type: 3}
|
||||
m_Name: NpcInteract
|
||||
m_EditorClassIdentifier:
|
||||
actions:
|
||||
- {fileID: 11400000, guid: 53ec3cb6384716d429b45c03bbf8ff18, type: 2}
|
||||
transitions:
|
||||
- decision: {fileID: 11400000, guid: a61bb8f83adfb6c44b3bb56e5163ec72, type: 2}
|
||||
trueState: {fileID: 11400000, guid: 78ec31c429ad5074bb50d001b1a49a77, type: 2}
|
||||
transitionValue: 1
|
||||
- decision: {fileID: 11400000, guid: 54c4574724be54540892c8db5aff93d1, type: 2}
|
||||
trueState: {fileID: 11400000, guid: 78ec31c429ad5074bb50d001b1a49a77, type: 2}
|
||||
transitionValue: 1
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 38fc01dae49e0514d8a6c2853b0ec37b
|
||||
timeCreated: 1507584986
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -9,11 +9,14 @@ MonoBehaviour:
|
|||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5a6a367e35acd7e44a0a598eaa1d6700, type: 3}
|
||||
m_Name: Roam
|
||||
m_Name: NpcRoam
|
||||
m_EditorClassIdentifier:
|
||||
actions:
|
||||
- {fileID: 11400000, guid: 2234a34b55804f1408179400cd3068e1, type: 2}
|
||||
transitions:
|
||||
- decision: {fileID: 11400000, guid: aca961c852aa698469b7c4d36142c175, type: 2}
|
||||
- decision: {fileID: 11400000, guid: 010846579b426744d84ebd4f5f2ce837, type: 2}
|
||||
trueState: {fileID: 11400000, guid: 963f4d74f828ef94d85740708e8ce1d0, type: 2}
|
||||
transitionValue: 1
|
||||
- decision: {fileID: 11400000, guid: c14d2053399388247b9cfde51ce5f57c, type: 2}
|
||||
trueState: {fileID: 11400000, guid: a70ae0bc5f16c9648ab8c7b1963547ac, type: 2}
|
||||
transitionValue: 1
|
|
@ -0,0 +1,28 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5a6a367e35acd7e44a0a598eaa1d6700, type: 3}
|
||||
m_Name: NpcWaitForInteractionAcceptance
|
||||
m_EditorClassIdentifier:
|
||||
actions:
|
||||
- {fileID: 11400000, guid: 8b6c25cdef34b7b408b0d79d1ce4d7c3, type: 2}
|
||||
transitions:
|
||||
- decision: {fileID: 11400000, guid: a3e30efde30a6294ba3fee0fa08b7417, type: 2}
|
||||
trueState: {fileID: 11400000, guid: 78ec31c429ad5074bb50d001b1a49a77, type: 2}
|
||||
transitionValue: 1
|
||||
- decision: {fileID: 11400000, guid: d1e5ed22b1756104794e4cdad03e7bd0, type: 2}
|
||||
trueState: {fileID: 11400000, guid: 38fc01dae49e0514d8a6c2853b0ec37b, type: 2}
|
||||
transitionValue: 1
|
||||
- decision: {fileID: 11400000, guid: 54c4574724be54540892c8db5aff93d1, type: 2}
|
||||
trueState: {fileID: 11400000, guid: 78ec31c429ad5074bb50d001b1a49a77, type: 2}
|
||||
transitionValue: 1
|
||||
- decision: {fileID: 11400000, guid: 010846579b426744d84ebd4f5f2ce837, type: 2}
|
||||
trueState: {fileID: 11400000, guid: 963f4d74f828ef94d85740708e8ce1d0, type: 2}
|
||||
transitionValue: 1
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a70ae0bc5f16c9648ab8c7b1963547ac
|
||||
timeCreated: 1507585011
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -9,7 +9,7 @@ MonoBehaviour:
|
|||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5a6a367e35acd7e44a0a598eaa1d6700, type: 3}
|
||||
m_Name: WaitForInteractionToEnd
|
||||
m_Name: NpcWaitForInteractionToEnd
|
||||
m_EditorClassIdentifier:
|
||||
actions:
|
||||
- {fileID: 11400000, guid: a239cb93f4d18fa4baf7a01d44718dbb, type: 2}
|
|
@ -2153,9 +2153,10 @@ MonoBehaviour:
|
|||
_isInteracting: 0
|
||||
interactions:
|
||||
- {fileID: 11400000, guid: 01a3cf8545fc70f4c90095f144ac9b01, type: 2}
|
||||
- {fileID: 11400000, guid: 7fc2c5ab600b7b64c832a95abea9589f, type: 2}
|
||||
- {fileID: 11400000, guid: 80ca1bec2c07531428cf5a84624e44a4, type: 2}
|
||||
spyInteractions:
|
||||
- {fileID: 11400000, guid: 218e2ddac8223e349a855bdae23819ab, type: 2}
|
||||
GlowColor: {r: 0, g: 0, b: 1, a: 0}
|
||||
currentState: {fileID: 11400000, guid: 1c694dfd46dd4e44b94f7853724fa1c0, type: 2}
|
||||
remainState: {fileID: 0}
|
||||
navMeshAgent: {fileID: 0}
|
||||
|
|
|
@ -15,6 +15,7 @@ public class IdleClickAction : Action
|
|||
controller.SelectedInteraction = null;
|
||||
controller.Interactor = null;
|
||||
controller.SelectedObject = null;
|
||||
controller.characterAnimator.SetBool(CharacterAnimator.Params.Interacting, false);
|
||||
}
|
||||
|
||||
public override void Act(StateController controller)
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(menuName = "CharacterStateMachine/Actions/NpcInteract")]
|
||||
public class NpcInteractAction : Action
|
||||
{
|
||||
public override void StartAct(StateController controller)
|
||||
{
|
||||
controller.characterAnimator.SetTrigger(controller.SelectedInteraction.initiatorAnimationTrigger);
|
||||
controller.characterAnimator.SetBool(CharacterAnimator.Params.Interacting, true);
|
||||
controller.MoveForSelectedObjectInteraction();
|
||||
}
|
||||
|
||||
public override void Act(StateController controller)
|
||||
{
|
||||
controller.FaceSelectedObject();
|
||||
}
|
||||
|
||||
public override void EndAct(StateController controller)
|
||||
{
|
||||
controller.FinishInteraction();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d597e878c9aa5f1478d29321afbd8919
|
||||
timeCreated: 1507020555
|
||||
guid: acbb53bdc7aa18d45a61fd8bac4ed071
|
||||
timeCreated: 1507584725
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(menuName = "CharacterStateMachine/Actions/NpcWaitForInteractionAcceptance")]
|
||||
public class NpcWaitForInteractionAcceptanceAction : Action
|
||||
{
|
||||
|
||||
public override void StartAct(StateController controller)
|
||||
{
|
||||
controller.InitiateInteractionWithSelectedObject();
|
||||
//controller.Destination = controller.SelectedObject.transform.position;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 73193a69302e61643a42134080a61e99
|
||||
timeCreated: 1507587780
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -9,13 +9,13 @@ public class RoamAction : Action
|
|||
{
|
||||
// Debug.Log("Started Roaming");
|
||||
controller.StartRoaming();
|
||||
controller.characterAnimator.SetBool(CharacterAnimator.Params.Interacting, false);
|
||||
}
|
||||
|
||||
public override void Act(StateController controller)
|
||||
{
|
||||
if (controller.Interactor != null && !controller.IsInteracting)
|
||||
if (controller.Interactor != null && !controller.IsInteracting && InRangeOfInteractor(controller))
|
||||
{
|
||||
// Debug.Log("Accepting incomming interaction!");
|
||||
controller.AcceptInteraction();
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,9 @@ public class RoamAction : Action
|
|||
// Debug.Log("Stopping coroutine");
|
||||
controller.StopRoaming();
|
||||
}
|
||||
|
||||
private bool InRangeOfInteractor(StateController controller)
|
||||
{
|
||||
return (controller.Interactor.transform.position - controller.transform.position).magnitude < StateController.INTERACT_RANGE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,18 +6,16 @@ public class SpyInteractAction : Action
|
|||
{
|
||||
public override void StartAct(StateController controller)
|
||||
{
|
||||
controller.characterAnimator.SetTrigger(controller.SelectedInteraction.characterInteraction);
|
||||
Vector3 awayDirection =(controller.transform.position - controller.SelectedObject.transform.position).normalized;
|
||||
Vector3 newPos = controller.SelectedObject.transform.position + awayDirection * controller.SelectedInteraction.interactionDistance;
|
||||
controller.navMeshAgent.stoppingDistance = 0.0f;
|
||||
controller.Destination = newPos;
|
||||
controller.characterAnimator.SetTrigger(controller.SelectedInteraction.initiatorAnimationTrigger);
|
||||
controller.characterAnimator.SetBool(CharacterAnimator.Params.Interacting, true);
|
||||
controller.MoveForSelectedObjectInteraction();
|
||||
}
|
||||
|
||||
public override void Act(StateController controller)
|
||||
{
|
||||
controller.FaceSelectedObject();
|
||||
AnimatorStateInfo info = controller.animator.GetCurrentAnimatorStateInfo(0);
|
||||
if (info.IsName(CharacterAnimator.GetParamName(controller.SelectedInteraction.characterInteraction)))
|
||||
if (info.IsName(CharacterAnimator.GetParamName(controller.SelectedInteraction.initiatorAnimationTrigger)))
|
||||
{
|
||||
float progress = info.normalizedTime;
|
||||
ProgressPanelController.ActivePanel.Progress = progress;
|
||||
|
|
|
@ -8,17 +8,5 @@ public class WaitForInteractionAcceptance : Action
|
|||
controller.InitiateInteractionWithSelectedObject();
|
||||
ProgressPanelController.ActivePanel.Reveal(controller.SelectedInteraction.interactionDescription);
|
||||
}
|
||||
|
||||
public override void EndAct(StateController controller)
|
||||
{
|
||||
//Debug.Log("Finished waiting for acceptance");
|
||||
}
|
||||
|
||||
private Interaction GetFirstInteraction(StateController controller)
|
||||
{
|
||||
if (controller.SelectedObject.interactions.Length > 0)
|
||||
return controller.SelectedObject.interactions[0];
|
||||
return controller.SelectedObject.spyInteractions[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@ public class WaitInPlaceAction : Action {
|
|||
if (!controller.IsInteracting)
|
||||
controller.IsInteracting = true;
|
||||
controller.Destination = controller.transform.position;
|
||||
controller.characterAnimator.SetBool(CharacterAnimator.Params.Interacting, true);
|
||||
controller.characterAnimator.SetTrigger(controller.Interactor.SelectedInteraction.objectAnimationTrigger);
|
||||
}
|
||||
|
||||
public override void Act(StateController controller)
|
||||
|
@ -25,5 +27,4 @@ public class WaitInPlaceAction : Action {
|
|||
controller.Interactor.characterAnimator.SetTrigger(CharacterAnimator.Params.Interrupted);
|
||||
controller.Interactor = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ public class CharacterAnimator : Photon.PunBehaviour
|
|||
|
||||
public enum Params
|
||||
{
|
||||
Idle, MoveSpeed, PassingMessage, Interrupted, Wave
|
||||
Idle, MoveSpeed, PassingMessage, Interrupted, Wave, Acknowledging, Handshake, Interacting, Bow
|
||||
}
|
||||
|
||||
protected virtual void Awake()
|
||||
|
@ -55,6 +55,16 @@ public class CharacterAnimator : Photon.PunBehaviour
|
|||
photonView.RPC("SetTriggerRPC", PhotonTargets.All, paramHashes[(int)param], true);
|
||||
}
|
||||
|
||||
public bool GetBool(Params param)
|
||||
{
|
||||
return animator.GetBool(paramHashes[(int)param]);
|
||||
}
|
||||
|
||||
public void SetBool(Params param, bool value)
|
||||
{
|
||||
photonView.RPC("SetBoolRPC", PhotonTargets.All, paramHashes[(int)param], value);
|
||||
}
|
||||
|
||||
public void ResetTrigger(Params param)
|
||||
{
|
||||
photonView.RPC("SetTriggerRPC", PhotonTargets.All, paramHashes[(int)param], false);
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(menuName = "CharacterStateMachine/Decisions/InitiatedInteraction")]
|
||||
public class InitiatedInteractionDecision : Decision
|
||||
|
|
|
@ -7,11 +7,6 @@ public class InterruptedDecision : Decision
|
|||
{
|
||||
public override bool Decide(StateController controller)
|
||||
{
|
||||
if (controller.characterAnimator.GetTrigger(CharacterAnimator.Params.Interrupted))
|
||||
{
|
||||
Debug.Log("Interrupted");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return controller.characterAnimator.GetTrigger(CharacterAnimator.Params.Interrupted);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ public class IsInteractingDecision : Decision
|
|||
{
|
||||
public override bool Decide(StateController controller)
|
||||
{
|
||||
return controller.IsInteracting;
|
||||
return controller.IsInteracting && controller.Interactor != null;
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(menuName = "CharacterStateMachine/Decisions/ObjectDeclinedInteraction")]
|
||||
class ObjectDeclinedInteractionDecision : Decision
|
||||
public class ObjectDeclinedInteractionDecision : Decision
|
||||
{
|
||||
public override bool Decide(StateController controller)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(menuName = "CharacterStateMachine/Decisions/ReceivingInteraction")]
|
||||
public class ReceivingInteractionDecision : Decision
|
||||
{
|
||||
public override bool Decide(StateController controller)
|
||||
{
|
||||
return controller.Interactor != null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5998aa6b572affe4a98a2e05c3ad4f0b
|
||||
timeCreated: 1507590145
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,11 @@
|
|||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(menuName = "CharacterStateMachine/Decisions/SelectedObject")]
|
||||
public class SelectedObjectDecision : Decision
|
||||
{
|
||||
public override bool Decide(StateController controller)
|
||||
{
|
||||
return controller.SelectedObject != null && controller.SelectedInteraction != null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 857349843f32b194e9bf5d2fe22ca2fc
|
||||
timeCreated: 1507584964
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -7,7 +7,7 @@ public class WaitForTransitionDecision : Decision
|
|||
{
|
||||
public override bool Decide(StateController controller)
|
||||
{
|
||||
string fromState = CharacterAnimator.GetParamName(controller.SelectedInteraction.characterInteraction);
|
||||
string fromState = CharacterAnimator.GetParamName(controller.SelectedInteraction.initiatorAnimationTrigger);
|
||||
string toState = CharacterAnimator.GetParamName(CharacterAnimator.Params.Idle);
|
||||
string transitionName = fromState + " -> " + toState;
|
||||
var currentTransition = controller.animator.GetAnimatorTransitionInfo(0);
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(menuName = "CharacterStateMachine/Decisions/YouAcceptedInteraction")]
|
||||
class YouAcceptedInteractionDecision : Decision
|
||||
public class YouAcceptedInteractionDecision : Decision
|
||||
{
|
||||
public override bool Decide(StateController controller)
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@ public class Interaction : ScriptableObject
|
|||
public string interactionDescription;
|
||||
[Tooltip("Descriptions follow the prompt \"Press 'E' to ...\"")]
|
||||
public string receiverDescription;
|
||||
public CharacterAnimator.Params characterInteraction;
|
||||
public CharacterAnimator.Params initiatorAnimationTrigger, objectAnimationTrigger;
|
||||
public InteractionResult result;
|
||||
public float initialRotation;
|
||||
public float objectInitialRotation;
|
||||
|
@ -18,11 +18,11 @@ public class Interaction : ScriptableObject
|
|||
{
|
||||
Nothing, SpyMissionComplete
|
||||
}
|
||||
|
||||
/*
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return interactionDescription.GetHashCode() ^ (int)characterInteraction;
|
||||
}
|
||||
}*/
|
||||
|
||||
public void ExecuteResult(StateController controller)
|
||||
{
|
||||
|
|
|
@ -17,6 +17,7 @@ public abstract class SelectableObject : Photon.PunBehaviour, IEquatable<Selecta
|
|||
// Interactions only spies can perform on this object
|
||||
public Interaction[] spyInteractions;
|
||||
|
||||
public static List<SelectableObject> objects;
|
||||
|
||||
private Color AvailableColor, InteractingColor;
|
||||
private bool isMousedOver = false;
|
||||
|
@ -74,6 +75,9 @@ public abstract class SelectableObject : Photon.PunBehaviour, IEquatable<Selecta
|
|||
|
||||
protected virtual void Start()
|
||||
{
|
||||
if (objects == null)
|
||||
objects = new List<SelectableObject>();
|
||||
objects.Add(this);
|
||||
isSpy = CompareTag("Spy");
|
||||
Renderers = GetComponentsInChildren<Renderer>();
|
||||
AvailableColor = Color.green;
|
||||
|
@ -84,6 +88,11 @@ public abstract class SelectableObject : Photon.PunBehaviour, IEquatable<Selecta
|
|||
}
|
||||
}
|
||||
|
||||
protected virtual void OnDestroy()
|
||||
{
|
||||
objects.Remove(this);
|
||||
}
|
||||
|
||||
public Color TargetColor
|
||||
{
|
||||
get
|
||||
|
@ -104,17 +113,18 @@ public abstract class SelectableObject : Photon.PunBehaviour, IEquatable<Selecta
|
|||
}
|
||||
}
|
||||
|
||||
protected virtual void Update()
|
||||
protected void LerpColors()
|
||||
{
|
||||
_currentColor = Color.Lerp(_currentColor, TargetColor, Time.deltaTime * LerpFactor);
|
||||
|
||||
for (int i = 0; i < _materials.Count; i++)
|
||||
{
|
||||
_materials[i].SetColor("_GlowColor", _currentColor);
|
||||
}
|
||||
}
|
||||
|
||||
if (Interactor != null && !isSpy)
|
||||
AcceptInteraction();
|
||||
protected virtual void Update()
|
||||
{
|
||||
LerpColors();
|
||||
}
|
||||
|
||||
private void OnMouseEnter()
|
||||
|
@ -144,6 +154,25 @@ public abstract class SelectableObject : Photon.PunBehaviour, IEquatable<Selecta
|
|||
return (interactions.Length + spyInteractions.Length) > 0;
|
||||
}
|
||||
|
||||
public bool HasNpcInteractions()
|
||||
{
|
||||
return (interactions.Length) > 0;
|
||||
}
|
||||
|
||||
public bool HasSpyInteractions()
|
||||
{
|
||||
return (spyInteractions.Length) > 0;
|
||||
}
|
||||
|
||||
public Interaction GetRandomNpcInteraction()
|
||||
{
|
||||
if (interactions.Length <= 0)
|
||||
Debug.LogError("Attempted to get a random npc interaction when " + name + " doesn't have any");
|
||||
|
||||
int randomIndex = UnityEngine.Random.Range(0, interactions.Length);
|
||||
return interactions[randomIndex];
|
||||
}
|
||||
|
||||
public virtual string GetInteractionTitle()
|
||||
{
|
||||
return "";
|
||||
|
@ -151,6 +180,7 @@ public abstract class SelectableObject : Photon.PunBehaviour, IEquatable<Selecta
|
|||
|
||||
public void AcceptInteraction()
|
||||
{
|
||||
Debug.Log("Accepted Interaction");
|
||||
IsInteracting = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,7 @@ public class StateController : SelectableObject
|
|||
{
|
||||
|
||||
public State currentState;
|
||||
public State remainState;
|
||||
public static readonly float INTERACT_RANGE = 1.5f;
|
||||
public static readonly float INTERACT_RANGE = 1.8f;
|
||||
|
||||
[HideInInspector] public NavMeshAgent navMeshAgent;
|
||||
[HideInInspector] public Animator animator;
|
||||
|
@ -53,12 +52,9 @@ public class StateController : SelectableObject
|
|||
|
||||
public void TransitionToState(State nextState)
|
||||
{
|
||||
if (nextState != remainState)
|
||||
{
|
||||
currentState.DoEndActions(this);
|
||||
currentState = nextState;
|
||||
currentState.DoStartActions(this);
|
||||
}
|
||||
currentState.DoEndActions(this);
|
||||
currentState = nextState;
|
||||
currentState.DoStartActions(this);
|
||||
}
|
||||
|
||||
public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
|
||||
|
@ -212,11 +208,41 @@ public class StateController : SelectableObject
|
|||
{
|
||||
while (true)
|
||||
{
|
||||
yield return new WaitForSeconds(UnityEngine.Random.value * 10.0f);
|
||||
yield return new WaitForSeconds(UnityEngine.Random.value * 2.0f + 2.0f);
|
||||
if (IsInteracting)
|
||||
Debug.LogError("Should have stopped this coroutine by now");
|
||||
if (UnityEngine.Random.value > 0.5f)
|
||||
{
|
||||
SelectableObject randomObject = GetRandomAvailableSelectableObject();
|
||||
if (randomObject != null)
|
||||
{
|
||||
SelectedObject = randomObject;
|
||||
IsInteracting = true;
|
||||
Interaction randomInteraction = SelectedObject.GetRandomNpcInteraction();
|
||||
SelectedInteraction = randomInteraction;
|
||||
Debug.Log(SelectedObject.name);
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
Destination = GetRandomLocation();
|
||||
}
|
||||
}
|
||||
|
||||
private SelectableObject GetRandomAvailableSelectableObject(int tries=0)
|
||||
{
|
||||
int randomIndex = UnityEngine.Random.Range(0, objects.Count);
|
||||
SelectableObject randomObject = objects[randomIndex];
|
||||
if (randomObject == this && randomObject.HasNpcInteractions() && !randomObject.Interactor && !randomObject.IsInteracting)
|
||||
{
|
||||
if (tries < 3)
|
||||
return GetRandomAvailableSelectableObject(tries++);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
return objects[randomIndex];
|
||||
}
|
||||
|
||||
public void FaceSelectedObject()
|
||||
{
|
||||
float progress = animator.GetCurrentAnimatorStateInfo(0).normalizedTime;
|
||||
|
@ -257,4 +283,12 @@ public class StateController : SelectableObject
|
|||
transform.rotation = Quaternion.Slerp(transform.rotation, facingRotation, Time.deltaTime * 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveForSelectedObjectInteraction()
|
||||
{
|
||||
Vector3 awayDirection = (transform.position - SelectedObject.transform.position).normalized;
|
||||
Vector3 newPos = SelectedObject.transform.position + awayDirection * SelectedInteraction.interactionDistance;
|
||||
navMeshAgent.stoppingDistance = 0.0f;
|
||||
Destination = newPos;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class GlowObject : MonoBehaviour
|
||||
{
|
||||
public Color GlowColor;
|
||||
public float LerpFactor = 10;
|
||||
|
||||
public Renderer[] Renderers
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public Color CurrentColor
|
||||
{
|
||||
get { return _currentColor; }
|
||||
}
|
||||
|
||||
private List<Material> _materials = new List<Material>();
|
||||
private Color _currentColor;
|
||||
private Color _targetColor;
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
Renderers = GetComponentsInChildren<Renderer>();
|
||||
|
||||
foreach (var renderer in Renderers)
|
||||
{
|
||||
_materials.AddRange(renderer.materials);
|
||||
}
|
||||
}
|
||||
|
||||
protected void OnMouseEnter()
|
||||
{
|
||||
_targetColor = GlowColor;
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
protected void OnMouseExit()
|
||||
{
|
||||
_targetColor = Color.black;
|
||||
_targetColor.a = 0.0f;
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loop over all cached materials and update their color, disable self if we reach our target color.
|
||||
/// </summary>
|
||||
protected void Update()
|
||||
{
|
||||
_currentColor = Color.Lerp(_currentColor, _targetColor, Time.deltaTime * LerpFactor);
|
||||
|
||||
for (int i = 0; i < _materials.Count; i++)
|
||||
{
|
||||
_materials[i].SetColor("_GlowColor", _currentColor);
|
||||
}
|
||||
|
||||
if (_currentColor.Equals(_targetColor))
|
||||
{
|
||||
enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
Reference in a new issue