Commit 1e7c30c1 by alsunj

Merge branch 'feat/shield' into 'main'

Added animation for defending and shield

See merge request alsunj/loputoo!17
parents c2d01808 c34ad009
...@@ -34,3 +34,8 @@ MonoBehaviour: ...@@ -34,3 +34,8 @@ MonoBehaviour:
SourcePrefabToOverride: {fileID: 0} SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0 SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0} OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 4994959905079220019, guid: c3c6003d148e24045a5699c460b258c9, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
...@@ -6,13 +6,14 @@ using UnityEngine; ...@@ -6,13 +6,14 @@ using UnityEngine;
public class GameManager : NetworkBehaviour public class GameManager : NetworkBehaviour
{ {
[SerializeField] private GameObject keyPrefab; [SerializeField] private GameObject keyPrefab;
[SerializeField] private bool startGame;
private TextMeshProUGUI _timerText; private TextMeshProUGUI _timerText;
private float _initialTimer = 10f; private float _initialTimer = 10f;
private float _startGameTimer = 10f; private float _startGameTimer = 10f;
private bool _initialTimerActive = true; private bool _initialTimerActive = true;
private bool _startGameTimerActive; private bool _startGameTimerActive;
private void Start() private void Start()
{ {
_timerText = GameObject.Find("Start_Game").GetComponent<TextMeshProUGUI>(); _timerText = GameObject.Find("Start_Game").GetComponent<TextMeshProUGUI>();
...@@ -24,7 +25,7 @@ public class GameManager : NetworkBehaviour ...@@ -24,7 +25,7 @@ public class GameManager : NetworkBehaviour
if (IsServer) if (IsServer)
{ {
_initialTimerActive = true; _initialTimerActive = startGame;
} }
} }
......
...@@ -4,11 +4,19 @@ public class PlayerEvents ...@@ -4,11 +4,19 @@ public class PlayerEvents
{ {
public event Action<bool> onPlayerWalk; public event Action<bool> onPlayerWalk;
public event Action<bool> onPlayerRun; public event Action<bool> onPlayerRun;
public event Action<bool> onPlayerDefence;
public event Action onPlayerInteract; public event Action onPlayerInteract;
public event Action onPlayerAttack; public event Action onPlayerAttack;
public void PlayerDefence(bool state)
{
if (onPlayerDefence != null)
{
onPlayerDefence(state);
}
}
public void PlayerWalk(bool state) public void PlayerWalk(bool state)
{ {
if (onPlayerWalk != null) if (onPlayerWalk != null)
......
using System;
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization;
public class PlayerManager : MonoBehaviour public class PlayerManager : MonoBehaviour
{ {
......
...@@ -8,6 +8,8 @@ public class PlayerAnimator : NetworkBehaviour ...@@ -8,6 +8,8 @@ public class PlayerAnimator : NetworkBehaviour
private const string IS_RUNNING = "IsRunning"; private const string IS_RUNNING = "IsRunning";
private const string IS_INTERACTING = "Interact"; private const string IS_INTERACTING = "Interact";
private const string IS_ATTACKING = "Attack"; private const string IS_ATTACKING = "Attack";
private const string IS_DEFENDING = "IsDefending";
private PlayerEvents _playerEvents; private PlayerEvents _playerEvents;
private Animator _animator; private Animator _animator;
...@@ -26,6 +28,7 @@ public class PlayerAnimator : NetworkBehaviour ...@@ -26,6 +28,7 @@ public class PlayerAnimator : NetworkBehaviour
_playerEvents.onPlayerRun -= SetPlayerRunBool; _playerEvents.onPlayerRun -= SetPlayerRunBool;
_playerEvents.onPlayerInteract -= SetPlayerInteract; _playerEvents.onPlayerInteract -= SetPlayerInteract;
_playerEvents.onPlayerAttack -= SetPlayerAttack; _playerEvents.onPlayerAttack -= SetPlayerAttack;
_playerEvents.onPlayerDefence -= SetPlayerDefence;
} }
} }
...@@ -38,6 +41,7 @@ public class PlayerAnimator : NetworkBehaviour ...@@ -38,6 +41,7 @@ public class PlayerAnimator : NetworkBehaviour
_playerEvents.onPlayerRun += SetPlayerRunBool; _playerEvents.onPlayerRun += SetPlayerRunBool;
_playerEvents.onPlayerInteract += SetPlayerInteract; _playerEvents.onPlayerInteract += SetPlayerInteract;
_playerEvents.onPlayerAttack += SetPlayerAttack; _playerEvents.onPlayerAttack += SetPlayerAttack;
_playerEvents.onPlayerDefence += SetPlayerDefence;
} }
} }
...@@ -49,14 +53,14 @@ public class PlayerAnimator : NetworkBehaviour ...@@ -49,14 +53,14 @@ public class PlayerAnimator : NetworkBehaviour
} }
} }
private void SetPlayerRunBool(bool obj) private void SetPlayerRunBool(bool state)
{ {
_animator.SetBool(IS_RUNNING, obj); _animator.SetBool(IS_RUNNING, state);
} }
private void SetPlayerWalkBool(bool obj) private void SetPlayerWalkBool(bool state)
{ {
_animator.SetBool(IS_WALKING, obj); _animator.SetBool(IS_WALKING, state);
} }
private void SetPlayerInteract() private void SetPlayerInteract()
...@@ -68,4 +72,13 @@ public class PlayerAnimator : NetworkBehaviour ...@@ -68,4 +72,13 @@ public class PlayerAnimator : NetworkBehaviour
{ {
_animator.CrossFade(IS_ATTACKING, 0.1f, -1, 0, 1f); _animator.CrossFade(IS_ATTACKING, 0.1f, -1, 0, 1f);
} }
private void SetPlayerDefence(bool state)
{
_animator.SetBool(IS_DEFENDING, state);
if (state)
{
_animator.CrossFade(IS_DEFENDING, 0.1f, -1, 0, 1f);
}
}
} }
\ No newline at end of file
...@@ -62,6 +62,13 @@ public class PlayerController : NetworkBehaviour ...@@ -62,6 +62,13 @@ public class PlayerController : NetworkBehaviour
#endregion #endregion
#region defenceProperties
public float defenceCooldown = 0.5f;
private float _defenceCooldownTimer;
#endregion
#region attackProperties #region attackProperties
public float hitDamage = 5f; public float hitDamage = 5f;
...@@ -84,6 +91,7 @@ public class PlayerController : NetworkBehaviour ...@@ -84,6 +91,7 @@ public class PlayerController : NetworkBehaviour
_playerManager.inputReader.InteractEvent -= OnInteract; _playerManager.inputReader.InteractEvent -= OnInteract;
_playerManager.inputReader.SprintEvent -= OnSprint; _playerManager.inputReader.SprintEvent -= OnSprint;
_playerManager.inputReader.AttackEvent -= OnAttack; _playerManager.inputReader.AttackEvent -= OnAttack;
_playerManager.inputReader.DefenceEvent -= OnDefence;
} }
} }
...@@ -93,6 +101,7 @@ public class PlayerController : NetworkBehaviour ...@@ -93,6 +101,7 @@ public class PlayerController : NetworkBehaviour
_playerManager.inputReader.InteractEvent += OnInteract; _playerManager.inputReader.InteractEvent += OnInteract;
_playerManager.inputReader.SprintEvent += OnSprint; _playerManager.inputReader.SprintEvent += OnSprint;
_playerManager.inputReader.AttackEvent += OnAttack; _playerManager.inputReader.AttackEvent += OnAttack;
_playerManager.inputReader.DefenceEvent += OnDefence;
} }
private void Start() private void Start()
...@@ -167,6 +176,20 @@ public class PlayerController : NetworkBehaviour ...@@ -167,6 +176,20 @@ public class PlayerController : NetworkBehaviour
_attackCooldownTimer = attackCooldown; // Set cooldown duration _attackCooldownTimer = attackCooldown; // Set cooldown duration
} }
private void OnDefence(bool state)
{
if (state)
{
if (_defenceCooldownTimer > 0) return;
PlayerDefend(state);
_defenceCooldownTimer = defenceCooldown; // Set cooldown duration
}
else
{
PlayerDefend(state);
}
}
private void OnInteract() private void OnInteract()
{ {
CheckForPickupableAndInteractableCollision(); CheckForPickupableAndInteractableCollision();
...@@ -184,6 +207,11 @@ public class PlayerController : NetworkBehaviour ...@@ -184,6 +207,11 @@ public class PlayerController : NetworkBehaviour
_attackCooldownTimer -= Time.deltaTime; _attackCooldownTimer -= Time.deltaTime;
} }
if (_defenceCooldownTimer > 0)
{
_defenceCooldownTimer -= Time.deltaTime;
}
if (enableSprint) if (enableSprint)
{ {
if (_isSprinting && !_isSprintCooldown) if (_isSprinting && !_isSprintCooldown)
...@@ -401,8 +429,15 @@ public class PlayerController : NetworkBehaviour ...@@ -401,8 +429,15 @@ public class PlayerController : NetworkBehaviour
} }
} }
private void PlayerDefend(bool state)
{
Debug.Log("player defending" + state);
_playerManager.playerEvents.PlayerDefence(state);
}
private void CheckForWeapons() private void CheckForWeapons()
{ {
//TODO: network variable with a damage based on the weapon
HitObject(hitDamage); HitObject(hitDamage);
} }
......
fileFormatVersion: 2
guid: 1a9da9b210813d34e8f11eac18327d36
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -4,18 +4,13 @@ using UnityEngine; ...@@ -4,18 +4,13 @@ using UnityEngine;
public interface IInputHandler public interface IInputHandler
{ {
event Action<Vector2> MoveEvent; event Action<Vector2> MoveEvent;
event Action<Vector2> LookEvent; event Action<Vector2> LookEvent;
event Action InteractEvent; event Action InteractEvent;
event Action JumpEvent; event Action JumpEvent;
event Action AttackEvent;
event Action<bool> SprintEvent; event Action<bool> SprintEvent;
event Action<bool> CrouchEvent; event Action<bool> CrouchEvent;
event Action<bool> DefenceEvent;
event Action AttackEvent;
void SimulateMove(Vector2 movement); void SimulateMove(Vector2 movement);
void SimulateInteract(); void SimulateInteract();
......
...@@ -10,9 +10,12 @@ public class InputReader : ScriptableObject, InputSystem_Actions.IPlayerActions, ...@@ -10,9 +10,12 @@ public class InputReader : ScriptableObject, InputSystem_Actions.IPlayerActions,
public event Action<Vector2> LookEvent; public event Action<Vector2> LookEvent;
public event Action InteractEvent; public event Action InteractEvent;
public event Action JumpEvent; public event Action JumpEvent;
public event Action AttackEvent;
public event Action<bool> SprintEvent; public event Action<bool> SprintEvent;
public event Action<bool> CrouchEvent; public event Action<bool> CrouchEvent;
public event Action AttackEvent;
public event Action<bool> DefenceEvent;
public void InitializeInput() public void InitializeInput()
{ {
...@@ -67,6 +70,18 @@ public class InputReader : ScriptableObject, InputSystem_Actions.IPlayerActions, ...@@ -67,6 +70,18 @@ public class InputReader : ScriptableObject, InputSystem_Actions.IPlayerActions,
} }
} }
public void OnDefence(InputAction.CallbackContext context)
{
if (context.performed)
{
DefenceEvent?.Invoke(true);
}
else if (context.canceled)
{
DefenceEvent?.Invoke(false);
}
}
public void OnInteract(InputAction.CallbackContext context) public void OnInteract(InputAction.CallbackContext context)
{ {
if (context.performed) if (context.performed)
......
...@@ -55,6 +55,15 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable ...@@ -55,6 +55,15 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable
""initialStateCheck"": false ""initialStateCheck"": false
}, },
{ {
""name"": ""Defence"",
""type"": ""Button"",
""id"": ""3c02f95e-5e66-48c8-add8-fc1918367d57"",
""expectedControlType"": """",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Interact"", ""name"": ""Interact"",
""type"": ""Button"", ""type"": ""Button"",
""id"": ""852140f2-7766-474d-8707-702459ba45f3"", ""id"": ""852140f2-7766-474d-8707-702459ba45f3"",
...@@ -260,7 +269,7 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable ...@@ -260,7 +269,7 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable
{ {
""name"": """", ""name"": """",
""id"": ""143bb1cd-cc10-4eca-a2f0-a3664166fe91"", ""id"": ""143bb1cd-cc10-4eca-a2f0-a3664166fe91"",
""path"": ""<Gamepad>/buttonWest"", ""path"": ""<Gamepad>/leftTrigger"",
""interactions"": """", ""interactions"": """",
""processors"": """", ""processors"": """",
""groups"": "";Gamepad"", ""groups"": "";Gamepad"",
...@@ -325,6 +334,39 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable ...@@ -325,6 +334,39 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable
}, },
{ {
""name"": """", ""name"": """",
""id"": ""db18eb48-27c1-483d-a77e-0e3af501c779"",
""path"": ""<Gamepad>/buttonEast"",
""interactions"": """",
""processors"": """",
""groups"": "";Gamepad"",
""action"": ""Defence"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""3209cfc4-56fb-433a-810b-9ccd7b93193a"",
""path"": ""<Gamepad>/rightTrigger"",
""interactions"": """",
""processors"": """",
""groups"": "";Keyboard&Mouse"",
""action"": ""Defence"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""a9e0ea63-35f9-4bc2-85e2-5f080975359d"",
""path"": ""<Mouse>/rightButton"",
""interactions"": """",
""processors"": """",
""groups"": "";Keyboard&Mouse"",
""action"": ""Defence"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""f2e9ba44-c423-42a7-ad56-f20975884794"", ""id"": ""f2e9ba44-c423-42a7-ad56-f20975884794"",
""path"": ""<Keyboard>/leftShift"", ""path"": ""<Keyboard>/leftShift"",
""interactions"": """", ""interactions"": """",
...@@ -1020,6 +1062,7 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable ...@@ -1020,6 +1062,7 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable
m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true); m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true);
m_Player_Look = m_Player.FindAction("Look", throwIfNotFound: true); m_Player_Look = m_Player.FindAction("Look", throwIfNotFound: true);
m_Player_Attack = m_Player.FindAction("Attack", throwIfNotFound: true); m_Player_Attack = m_Player.FindAction("Attack", throwIfNotFound: true);
m_Player_Defence = m_Player.FindAction("Defence", throwIfNotFound: true);
m_Player_Interact = m_Player.FindAction("Interact", throwIfNotFound: true); m_Player_Interact = m_Player.FindAction("Interact", throwIfNotFound: true);
m_Player_Crouch = m_Player.FindAction("Crouch", throwIfNotFound: true); m_Player_Crouch = m_Player.FindAction("Crouch", throwIfNotFound: true);
m_Player_Jump = m_Player.FindAction("Jump", throwIfNotFound: true); m_Player_Jump = m_Player.FindAction("Jump", throwIfNotFound: true);
...@@ -1106,6 +1149,7 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable ...@@ -1106,6 +1149,7 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable
private readonly InputAction m_Player_Move; private readonly InputAction m_Player_Move;
private readonly InputAction m_Player_Look; private readonly InputAction m_Player_Look;
private readonly InputAction m_Player_Attack; private readonly InputAction m_Player_Attack;
private readonly InputAction m_Player_Defence;
private readonly InputAction m_Player_Interact; private readonly InputAction m_Player_Interact;
private readonly InputAction m_Player_Crouch; private readonly InputAction m_Player_Crouch;
private readonly InputAction m_Player_Jump; private readonly InputAction m_Player_Jump;
...@@ -1117,6 +1161,7 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable ...@@ -1117,6 +1161,7 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable
public InputAction @Move => m_Wrapper.m_Player_Move; public InputAction @Move => m_Wrapper.m_Player_Move;
public InputAction @Look => m_Wrapper.m_Player_Look; public InputAction @Look => m_Wrapper.m_Player_Look;
public InputAction @Attack => m_Wrapper.m_Player_Attack; public InputAction @Attack => m_Wrapper.m_Player_Attack;
public InputAction @Defence => m_Wrapper.m_Player_Defence;
public InputAction @Interact => m_Wrapper.m_Player_Interact; public InputAction @Interact => m_Wrapper.m_Player_Interact;
public InputAction @Crouch => m_Wrapper.m_Player_Crouch; public InputAction @Crouch => m_Wrapper.m_Player_Crouch;
public InputAction @Jump => m_Wrapper.m_Player_Jump; public InputAction @Jump => m_Wrapper.m_Player_Jump;
...@@ -1139,6 +1184,9 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable ...@@ -1139,6 +1184,9 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable
@Attack.started += instance.OnAttack; @Attack.started += instance.OnAttack;
@Attack.performed += instance.OnAttack; @Attack.performed += instance.OnAttack;
@Attack.canceled += instance.OnAttack; @Attack.canceled += instance.OnAttack;
@Defence.started += instance.OnDefence;
@Defence.performed += instance.OnDefence;
@Defence.canceled += instance.OnDefence;
@Interact.started += instance.OnInteract; @Interact.started += instance.OnInteract;
@Interact.performed += instance.OnInteract; @Interact.performed += instance.OnInteract;
@Interact.canceled += instance.OnInteract; @Interact.canceled += instance.OnInteract;
...@@ -1164,6 +1212,9 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable ...@@ -1164,6 +1212,9 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable
@Attack.started -= instance.OnAttack; @Attack.started -= instance.OnAttack;
@Attack.performed -= instance.OnAttack; @Attack.performed -= instance.OnAttack;
@Attack.canceled -= instance.OnAttack; @Attack.canceled -= instance.OnAttack;
@Defence.started -= instance.OnDefence;
@Defence.performed -= instance.OnDefence;
@Defence.canceled -= instance.OnDefence;
@Interact.started -= instance.OnInteract; @Interact.started -= instance.OnInteract;
@Interact.performed -= instance.OnInteract; @Interact.performed -= instance.OnInteract;
@Interact.canceled -= instance.OnInteract; @Interact.canceled -= instance.OnInteract;
...@@ -1361,6 +1412,7 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable ...@@ -1361,6 +1412,7 @@ public partial class @InputSystem_Actions: IInputActionCollection2, IDisposable
void OnMove(InputAction.CallbackContext context); void OnMove(InputAction.CallbackContext context);
void OnLook(InputAction.CallbackContext context); void OnLook(InputAction.CallbackContext context);
void OnAttack(InputAction.CallbackContext context); void OnAttack(InputAction.CallbackContext context);
void OnDefence(InputAction.CallbackContext context);
void OnInteract(InputAction.CallbackContext context); void OnInteract(InputAction.CallbackContext context);
void OnCrouch(InputAction.CallbackContext context); void OnCrouch(InputAction.CallbackContext context);
void OnJump(InputAction.CallbackContext context); void OnJump(InputAction.CallbackContext context);
......
...@@ -33,6 +33,15 @@ ...@@ -33,6 +33,15 @@
"initialStateCheck": false "initialStateCheck": false
}, },
{ {
"name": "Defence",
"type": "Button",
"id": "3c02f95e-5e66-48c8-add8-fc1918367d57",
"expectedControlType": "",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "Interact", "name": "Interact",
"type": "Button", "type": "Button",
"id": "852140f2-7766-474d-8707-702459ba45f3", "id": "852140f2-7766-474d-8707-702459ba45f3",
...@@ -238,7 +247,7 @@ ...@@ -238,7 +247,7 @@
{ {
"name": "", "name": "",
"id": "143bb1cd-cc10-4eca-a2f0-a3664166fe91", "id": "143bb1cd-cc10-4eca-a2f0-a3664166fe91",
"path": "<Gamepad>/buttonWest", "path": "<Gamepad>/leftTrigger",
"interactions": "", "interactions": "",
"processors": "", "processors": "",
"groups": ";Gamepad", "groups": ";Gamepad",
...@@ -303,6 +312,39 @@ ...@@ -303,6 +312,39 @@
}, },
{ {
"name": "", "name": "",
"id": "db18eb48-27c1-483d-a77e-0e3af501c779",
"path": "<Gamepad>/buttonEast",
"interactions": "",
"processors": "",
"groups": ";Gamepad",
"action": "Defence",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "3209cfc4-56fb-433a-810b-9ccd7b93193a",
"path": "<Gamepad>/rightTrigger",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "Defence",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "a9e0ea63-35f9-4bc2-85e2-5f080975359d",
"path": "<Mouse>/rightButton",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "Defence",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "f2e9ba44-c423-42a7-ad56-f20975884794", "id": "f2e9ba44-c423-42a7-ad56-f20975884794",
"path": "<Keyboard>/leftShift", "path": "<Keyboard>/leftShift",
"interactions": "", "interactions": "",
......
fileFormatVersion: 2
guid: 731916a65c99ae14db0dca2952a48a90
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This source diff could not be displayed because it is too large. You can view the blob instead.
fileFormatVersion: 2
guid: 2533a95934a9ea044a5454189730090b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c926973962e00474bb28fe38228d6c27
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4994959905079220019
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7801895876235266027}
- component: {fileID: 6720401888809174077}
- component: {fileID: 2406308509100318415}
m_Layer: 0
m_Name: Managers
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7801895876235266027
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4994959905079220019}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1.9441636, y: -0.5603608, z: -1.2710799}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6720401888809174077
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4994959905079220019}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier:
GlobalObjectIdHash: 1158095512
InScenePlacedSourceGlobalObjectIdHash: 0
DeferredDespawnTick: 0
Ownership: 1
AlwaysReplicateAsRoot: 0
SynchronizeTransform: 1
ActiveSceneSynchronization: 0
SceneMigrationSynchronization: 1
SpawnWithObservers: 1
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
SyncOwnerTransformWhenParented: 1
AllowOwnerToParent: 0
--- !u!114 &2406308509100318415
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4994959905079220019}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9c71552cd67eabf489fab4fe0d80a0f9, type: 3}
m_Name:
m_EditorClassIdentifier:
ShowTopMostFoldoutHeaderGroup: 1
keyPrefab: {fileID: 8050255731901760503, guid: 1d9ae894a89fd38449f1ce889f52d1ad, type: 3}
startGame: 0
fileFormatVersion: 2
guid: c3c6003d148e24045a5699c460b258c9
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -64,6 +64,7 @@ AnimatorState: ...@@ -64,6 +64,7 @@ AnimatorState:
- {fileID: 2561986876081676319} - {fileID: 2561986876081676319}
- {fileID: -7829200255183543722} - {fileID: -7829200255183543722}
- {fileID: -2454258677163262022} - {fileID: -2454258677163262022}
- {fileID: 2830754513711194138}
m_StateMachineBehaviours: [] m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0} m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0 m_IKOnFeet: 0
...@@ -79,6 +80,31 @@ AnimatorState: ...@@ -79,6 +80,31 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1101 &-3316897107227661968
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: IsDefending
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -6917854663193515141}
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!1107 &-3044030813590008245 --- !u!1107 &-3044030813590008245
AnimatorStateMachine: AnimatorStateMachine:
serializedVersion: 6 serializedVersion: 6
...@@ -103,6 +129,9 @@ AnimatorStateMachine: ...@@ -103,6 +129,9 @@ AnimatorStateMachine:
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 7653408459867535690} m_State: {fileID: 7653408459867535690}
m_Position: {x: -300, y: 210, z: 0} m_Position: {x: -300, y: 210, z: 0}
- serializedVersion: 1
m_State: {fileID: 7602732044374560133}
m_Position: {x: -10, y: 230, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: [] m_AnyStateTransitions: []
m_EntryTransitions: [] m_EntryTransitions: []
...@@ -206,6 +235,12 @@ AnimatorController: ...@@ -206,6 +235,12 @@ AnimatorController:
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 9100000}
- m_Name: IsDefending
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Interact - m_Name: Interact
m_Type: 9 m_Type: 9
m_DefaultFloat: 0 m_DefaultFloat: 0
...@@ -335,6 +370,31 @@ AnimatorStateTransition: ...@@ -335,6 +370,31 @@ AnimatorStateTransition:
m_InterruptionSource: 0 m_InterruptionSource: 0
m_OrderedInterruption: 1 m_OrderedInterruption: 1
m_CanTransitionToSelf: 1 m_CanTransitionToSelf: 1
--- !u!1101 &2830754513711194138
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: IsDefending
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 7602732044374560133}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.765625
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &5824969481171216955 --- !u!1102 &5824969481171216955
AnimatorState: AnimatorState:
serializedVersion: 6 serializedVersion: 6
...@@ -363,6 +423,33 @@ AnimatorState: ...@@ -363,6 +423,33 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1102 &7602732044374560133
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Defend
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -3316897107227661968}
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: -6801083763907307519, guid: 239fd912fdc786a4cb361c17f68877d9, type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &7653408459867535690 --- !u!1102 &7653408459867535690
AnimatorState: AnimatorState:
serializedVersion: 6 serializedVersion: 6
......
...@@ -202,7 +202,7 @@ MonoBehaviour: ...@@ -202,7 +202,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
GlobalObjectIdHash: 425717663 GlobalObjectIdHash: 3775582031
InScenePlacedSourceGlobalObjectIdHash: 425717663 InScenePlacedSourceGlobalObjectIdHash: 425717663
DeferredDespawnTick: 0 DeferredDespawnTick: 0
Ownership: 1 Ownership: 1
...@@ -243,6 +243,7 @@ MonoBehaviour: ...@@ -243,6 +243,7 @@ MonoBehaviour:
walkSpeed: 9 walkSpeed: 9
maxVelocityChange: 10 maxVelocityChange: 10
fov: 60 fov: 60
defenceCooldown: 0.5
hitDamage: 5 hitDamage: 5
attackCooldown: 1 attackCooldown: 1
--- !u!136 &1490898689994747714 --- !u!136 &1490898689994747714
...@@ -390,7 +391,8 @@ Transform: ...@@ -390,7 +391,8 @@ Transform:
m_LocalPosition: {x: 0, y: 0.17, z: 0} m_LocalPosition: {x: 0, y: 0.17, 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:
- {fileID: 4407729594129973479}
m_Father: {fileID: 7293214330416234456} m_Father: {fileID: 7293214330416234456}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8981085374916285117 --- !u!1 &8981085374916285117
...@@ -456,6 +458,68 @@ Transform: ...@@ -456,6 +458,68 @@ Transform:
- {fileID: 6288134246550524770} - {fileID: 6288134246550524770}
m_Father: {fileID: 2637631208202168134} m_Father: {fileID: 2637631208202168134}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &4224903988600203020
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 519076570400475094}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
propertyPath: m_LocalPosition.x
value: -0.104
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
propertyPath: m_LocalPosition.y
value: 0.003
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
propertyPath: m_LocalPosition.z
value: 0.048
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
propertyPath: m_LocalRotation.w
value: 0.9396927
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
propertyPath: m_LocalRotation.y
value: -0.3420201
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -40
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
propertyPath: m_Name
value: Skeleton_Shield_Small_A
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
--- !u!4 &4407729594129973479 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 992171d1e43d4d3409b1bbc62ab7f68e, type: 3}
m_PrefabInstance: {fileID: 4224903988600203020}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &5821265037223900297 --- !u!1001 &5821265037223900297
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
fileFormatVersion: 2
guid: e9efe02b8a1383c449c67bb1ba25f40b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
public class Shield : MonoBehaviour
{
private MeshCollider _shieldCollider;
void Start()
{
_shieldCollider = GetComponent<MeshCollider>();
}
}
fileFormatVersion: 2
guid: e5a029138c30a7b41aacf6c38d1de068
\ No newline at end of file
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7282908504044119513
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 656888585651858308}
m_Layer: 0
m_Name: Shield
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &656888585651858308
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7282908504044119513}
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: 0
m_Children:
- {fileID: 5151169727346497949}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &4680956274496945782
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 656888585651858308}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
propertyPath: m_LocalPosition.y
value: -0.17
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
propertyPath: m_LocalRotation.w
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
propertyPath: m_LocalRotation.x
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
propertyPath: m_LocalRotation.z
value: -0.7071068
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 180
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 90
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
propertyPath: m_Name
value: Skeleton_Shield_Large_A
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
insertIndex: -1
addedObject: {fileID: 6966028400646605147}
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
insertIndex: -1
addedObject: {fileID: 2067167096600176798}
m_SourcePrefab: {fileID: 100100000, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
--- !u!4 &5151169727346497949 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
m_PrefabInstance: {fileID: 4680956274496945782}
m_PrefabAsset: {fileID: 0}
--- !u!1 &5491982788859757351 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
m_PrefabInstance: {fileID: 4680956274496945782}
m_PrefabAsset: {fileID: 0}
--- !u!114 &6966028400646605147
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5491982788859757351}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e5a029138c30a7b41aacf6c38d1de068, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!64 &2067167096600176798
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5491982788859757351}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: -408259373467118210, guid: cc7c757e7290f864da3c554181fd3c92, type: 3}
fileFormatVersion: 2
guid: 0ff7afd89024f7c498fca25b81a23be7
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment