Merge remote-tracking branch 'origin/master'

This commit is contained in:
KrolMel 2023-01-05 15:20:45 +01:00
commit f2215c3638
15 changed files with 254 additions and 43 deletions

View File

@ -1,5 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1101 &-5806975412209012471
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: isRunning
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 5154281723833786323}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1107 &-3621334542891261866
AnimatorStateMachine:
serializedVersion: 6
@ -15,6 +40,9 @@ AnimatorStateMachine:
- serializedVersion: 1
m_State: {fileID: 5154281723833786323}
m_Position: {x: 420, y: 210, z: 0}
- serializedVersion: 1
m_State: {fileID: -439700991718221505}
m_Position: {x: 800, y: -20, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
@ -88,7 +116,7 @@ BlendTree:
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: b900c5133de323a46a58498a00abc987, type: 2}
m_Threshold: 0
m_Position: {x: 0, y: -1}
m_Position: {x: 0, y: 1}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: Blend
@ -96,7 +124,7 @@ BlendTree:
- serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 3233cd06998b20547adc8836d0a3f51a, type: 2}
m_Threshold: 0.33333334
m_Position: {x: 0, y: 1}
m_Position: {x: 0, y: -1}
m_TimeScale: 1
m_CycleOffset: 0
m_DirectBlendParameter: Blend
@ -117,13 +145,40 @@ BlendTree:
m_CycleOffset: 0
m_DirectBlendParameter: Blend
m_Mirror: 0
m_BlendParameter: moveX
m_BlendParameterY: moveY
m_BlendParameter: Xinfo
m_BlendParameterY: Yinfo
m_MinThreshold: 0
m_MaxThreshold: 1
m_UseAutomaticThresholds: 1
m_NormalizedBlendValues: 0
m_BlendType: 1
--- !u!1102 &-439700991718221505
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: WizardFrontIdle
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -5806975412209012471}
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_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 90f3fe0e624b43c44b515016d52dfbae, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
@ -139,18 +194,30 @@ AnimatorController:
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
- m_Name: moveX
- m_Name: Xinfo
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
- m_Name: moveY
- m_Name: Yinfo
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
- m_Name: TurnBack
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
- m_Name: TurnFront
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@ -172,6 +239,9 @@ AnimatorStateTransition:
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: TurnFront
m_EventTreshold: 0
- m_ConditionMode: 2
m_ConditionEvent: isRunning
m_EventTreshold: 0
@ -189,6 +259,34 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &3909964258867045483
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: isRunning
m_EventTreshold: 0
- m_ConditionMode: 1
m_ConditionEvent: TurnFront
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -439700991718221505}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &5154281723833786323
AnimatorState:
serializedVersion: 6
@ -201,6 +299,7 @@ AnimatorState:
m_CycleOffset: 0
m_Transitions:
- {fileID: 3234619281913491369}
- {fileID: 3909964258867045483}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0

View File

@ -39649,6 +39649,10 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 1393757793}
m_Modifications:
- target: {fileID: -7576677615092044163, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: speed
value: 1.3
objectReference: {fileID: 0}
- target: {fileID: -7576677615092044163, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: isChasing
value: 0

View File

@ -38,6 +38,7 @@ public class ChangeScene : MonoBehaviour
if(collision.gameObject.tag == "AnimatedDoorSceneTransition")
{
Debug.Log("Starting coroutine");
StartCoroutine(WaitForAnimationAndMoveToScene(0.3f, collision));
}
}

View File

@ -5,7 +5,7 @@ using UnityEngine;
public class TriggerDoor : DetectionZone
{
public string DoorOpenAnimatorParamName = "DoorOpen";
public static bool ableToOpen = false;
Animator animator;
void Start(){
@ -15,6 +15,8 @@ public class TriggerDoor : DetectionZone
void Update() {
if(detectedObjs.Count > 0) {
animator.SetBool(DoorOpenAnimatorParamName, true);
ableToOpen = true;
} else {
animator.SetBool(DoorOpenAnimatorParamName, false);
}

View File

@ -35,7 +35,7 @@ public class KeyBindScript : MonoBehaviour
void Start()
{
keys.Add("Interact",(KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Interact","E")));
keys.Add("Settings",(KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Settings","Esc")));
keys.Add("Settings",(KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Settings","Escape")));
keys.Add("Inventory",(KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Inventory","I")));
keys.Add("Skills",(KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Skills","U")));
keys.Add("Attack",(KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Attack","Space")));

View File

@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using GUI_Scripts.ProceduralGeneration;
using UnityEngine;
[RequireComponent(typeof(NPC))]
@ -69,6 +70,7 @@ public class NPCFollowing : MonoBehaviour
public void CheckDistance()
{
anim.SetBool("isRunning", true);
StopAllCoroutines();
if (isAfterAction == false)
@ -78,13 +80,23 @@ public class NPCFollowing : MonoBehaviour
agent.FindPath();
StartCoroutine(agent.FollowPath());
}
else if (approaching)
{
//start dialogue here
gameObject.GetComponent<NPC>().State = NPCStateEnum.Talking;
if (targetPosition.position.y > transform.position.y)
{
anim.SetBool("TurnFront",true);
anim.SetBool("isRunning", false);
}
else
{
anim.SetBool("TurnFront",false);
anim.SetBool("isRunning", false);
}
agent.path.Clear(); // if we are able to talgk we dont want go go further player
}
}
@ -105,6 +117,7 @@ public class NPCFollowing : MonoBehaviour
}
else
{
anim.SetBool("isChasing", false);
gameObject.GetComponent<NPC>().State = NPCStateEnum.Pending;
}
}

View File

@ -54,6 +54,14 @@ public class AStarPathfindingAgent : MonoBehaviour
Pathfinder.FindPath(transform.position, point, this);
}
public void ControlAnim()
{
moveX = point.x - transform.position.x;
moveY = point.y - transform.position.y;
myAnim.SetFloat("Yinfo", moveY);
myAnim.SetFloat("Xinfo", moveX);
}
public IEnumerator FollowPath()
{
myAnim = GetComponent<Animator>();
@ -101,8 +109,10 @@ public class AStarPathfindingAgent : MonoBehaviour
myAnim.SetBool("Left", false);
}
moveX = point.x - current.x;
moveY = point.y - current.y;
//moveX = path[targetIndex].worldPosition.x - current.x;
//moveY = path[targetIndex].worldPosition.y - current.y;
moveX = point.x - current.x;
moveY = point.y - current.y;
myAnim.SetFloat("Yinfo", moveY);
myAnim.SetFloat("Xinfo", moveX);

View File

@ -46,10 +46,15 @@ public class NPCManager : MonoBehaviour
{
throw new Exception("Object not found");
}
CreateThugs();
CreateBossThug();
if (GameObject.FindGameObjectWithTag("EnemyCollection").transform.Find(bossThug.name) == null)
{
Debug.Log("Build me :D");
CreateBossThug();
CreateThugs();
}
}
private void CreateThugs()
{
var model = Resources.Load("SampleScene/Enemies/Thug") as GameObject;
@ -83,6 +88,7 @@ public class NPCManager : MonoBehaviour
private void CreateBossThug()
{
Debug.Log("BOSS THUG IS CREATED!");
var modelBossThug = Resources.Load("SampleScene/Enemies/BossThug") as GameObject;
var BossThugClone = GameObject.Instantiate(modelBossThug, bossThug.position, Quaternion.identity, NPCCollection.transform);

View File

@ -21,15 +21,15 @@ AnimationClip:
- curve:
- time: 0
value: {fileID: 8686923130848968836, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
- time: 0.083333336
value: {fileID: 2429924255151692236, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
- time: 0.16666667
value: {fileID: 2429924255151692236, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
- time: 0.33333334
value: {fileID: -1549776866798367382, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 12
m_SampleRate: 6
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
@ -52,7 +52,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.25
m_StopTime: 0.5
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0

View File

@ -0,0 +1,68 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: WizardFrontIdle
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 1425329180273031634, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 12
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 1425329180273031634, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.083333336
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 90f3fe0e624b43c44b515016d52dfbae
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -21,15 +21,15 @@ AnimationClip:
- curve:
- time: 0
value: {fileID: 5831712680124928391, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
- time: 0.083333336
value: {fileID: 7058171408329882253, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
- time: 0.16666667
value: {fileID: 7058171408329882253, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
- time: 0.33333334
value: {fileID: 5758504133813651979, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 12
m_SampleRate: 6
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
@ -52,7 +52,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.25
m_StopTime: 0.5
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0

View File

@ -21,15 +21,15 @@ AnimationClip:
- curve:
- time: 0
value: {fileID: -6546816321944170997, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
- time: 0.083333336
value: {fileID: -2446265752164650608, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
- time: 0.16666667
value: {fileID: -2446265752164650608, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
- time: 0.33333334
value: {fileID: -2017559570444700374, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 12
m_SampleRate: 6
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
@ -52,7 +52,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.25
m_StopTime: 0.5
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0

View File

@ -21,15 +21,15 @@ AnimationClip:
- curve:
- time: 0
value: {fileID: 3351906410715979375, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
- time: 0.083333336
value: {fileID: 1425329180273031634, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
- time: 0.16666667
value: {fileID: 1425329180273031634, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
- time: 0.33333334
value: {fileID: -2357918661749186383, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 12
m_SampleRate: 6
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
@ -52,7 +52,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.25
m_StopTime: 0.5
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0

View File

@ -6,35 +6,35 @@ EditorUserSettings:
serializedVersion: 4
m_ConfigSettings:
RecentlyUsedScenePath-0:
value: 22424703114646680e0b0227036c7c151b12163e2d3a3f7e38271427fb
flags: 0
RecentlyUsedScenePath-1:
value: 22424703114646680e0b0227036c72111f1958072926337e38271427fb
flags: 0
RecentlyUsedScenePath-2:
value: 22424703114646680e0b0227036c72111f19352f223d667d6d0a123df6f23b34f1a923e7ee2e26
flags: 0
RecentlyUsedScenePath-3:
RecentlyUsedScenePath-1:
value: 200b1b3316501b4842040d290521103419001626232922236202182ac0e93a3cf1a817faf43f2b2f7631ec390a3b4f2afc031d12
flags: 0
RecentlyUsedScenePath-4:
RecentlyUsedScenePath-2:
value: 22424703114646680e0b0227036c7c1102161b25212a357e38271427fb
flags: 0
RecentlyUsedScenePath-5:
RecentlyUsedScenePath-3:
value: 22424703114646680e0b0227036c761e1821112620292135633c133af6f9
flags: 0
RecentlyUsedScenePath-6:
RecentlyUsedScenePath-4:
value: 22424703114646680e0b0227036c7c1100123d24383a273e2e2c5326ece92021
flags: 0
RecentlyUsedScenePath-7:
value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
RecentlyUsedScenePath-5:
value: 22424703114646680e0b0227036c791904040c1c25242a312a2c5326ece92021
flags: 0
RecentlyUsedScenePath-8:
RecentlyUsedScenePath-6:
value: 22424703114646680e0b0227036c70050204112e291f2f2a2c3b1920caef212be7a923e7ee2e26
flags: 0
RecentlyUsedScenePath-9:
RecentlyUsedScenePath-7:
value: 22424703114646680e0b0227036c72111f1958072926337e38271427fb
flags: 0
RecentlyUsedScenePath-8:
value: 22424703114646680e0b0227036c68190c160a2e042733232867083debf42d
flags: 0
RecentlyUsedScenePath-9:
value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650
flags: 0