Commit 1d8003f2 by alsunj

Added destructables, improved interactions between objects

parent 28ee9ba5
...@@ -19,3 +19,8 @@ MonoBehaviour: ...@@ -19,3 +19,8 @@ MonoBehaviour:
SourcePrefabToOverride: {fileID: 0} SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0 SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0} OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 334567762338569054, guid: dc502d59cef13ed40b07aa18bd1a4167, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
fileFormatVersion: 2
guid: ac977d8779311ad40a86639df00591bd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System;
using DG.Tweening;
using UnityEngine;
public class Barrel : MonoBehaviour, IDestrucable
{
[SerializeField] private DestructableSettings _destructableSettings;
private float _health;
private void Start()
{
_health = _destructableSettings.health;
}
public void TakeDamage(float damage)
{
_health -= damage;
Debug.Log(_health);
if (_health <= 0)
{
transform.DOScale(Vector3.zero, 0.5f).SetDelay(_destructableSettings.hitDelay)
.OnComplete(() => gameObject.SetActive(false));
}
else
{
transform.DOShakePosition(0.5f, _destructableSettings.shakeOffset, 10, 90, false, true)
.SetDelay(_destructableSettings.hitDelay);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: ed4e03c2301e55647a46a17478fe384a
\ No newline at end of file
using UnityEngine;
[CreateAssetMenu(fileName = "DestructableSettings", menuName = "Scriptable Objects/DestructableSettings")]
public class DestructableSettings : ScriptableObject
{
public float health = 20f;
public float hitDelay = 1f;
public Vector3 shakeOffset = new Vector3(0.2f, 0, 0.2f);
}
\ No newline at end of file
fileFormatVersion: 2
guid: f0865dc671f389940b7c393a0a448838
\ No newline at end of file
using UnityEngine;
public interface IDestrucable
{
void TakeDamage(float damage);
}
\ No newline at end of file
fileFormatVersion: 2
guid: c241e5cd63a3b9a4d99b9d1b6e87d402
\ No newline at end of file
...@@ -6,6 +6,8 @@ public class PlayerEvents ...@@ -6,6 +6,8 @@ public class PlayerEvents
public event Action<bool> onPlayerRun; public event Action<bool> onPlayerRun;
public event Action onPlayerInteract; public event Action onPlayerInteract;
public event Action onPlayerAttack;
public void PlayerWalk(bool state) public void PlayerWalk(bool state)
{ {
...@@ -30,4 +32,12 @@ public class PlayerEvents ...@@ -30,4 +32,12 @@ public class PlayerEvents
onPlayerInteract(); onPlayerInteract();
} }
} }
public void PlayerAttack()
{
if (onPlayerAttack != null)
{
onPlayerAttack();
}
}
} }
\ No newline at end of file
...@@ -7,6 +7,7 @@ public class PlayerAnimator : NetworkBehaviour ...@@ -7,6 +7,7 @@ public class PlayerAnimator : NetworkBehaviour
private const string IS_WALKING = "IsWalking"; private const string IS_WALKING = "IsWalking";
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 PlayerEvents _playerEvents; private PlayerEvents _playerEvents;
private Animator _animator; private Animator _animator;
...@@ -24,6 +25,7 @@ public class PlayerAnimator : NetworkBehaviour ...@@ -24,6 +25,7 @@ public class PlayerAnimator : NetworkBehaviour
_playerEvents.onPlayerWalk -= SetPlayerWalkBool; _playerEvents.onPlayerWalk -= SetPlayerWalkBool;
_playerEvents.onPlayerRun -= SetPlayerRunBool; _playerEvents.onPlayerRun -= SetPlayerRunBool;
_playerEvents.onPlayerInteract -= SetPlayerInteract; _playerEvents.onPlayerInteract -= SetPlayerInteract;
_playerEvents.onPlayerAttack -= SetPlayerAttack;
} }
} }
...@@ -35,6 +37,7 @@ public class PlayerAnimator : NetworkBehaviour ...@@ -35,6 +37,7 @@ public class PlayerAnimator : NetworkBehaviour
_playerEvents.onPlayerWalk += SetPlayerWalkBool; _playerEvents.onPlayerWalk += SetPlayerWalkBool;
_playerEvents.onPlayerRun += SetPlayerRunBool; _playerEvents.onPlayerRun += SetPlayerRunBool;
_playerEvents.onPlayerInteract += SetPlayerInteract; _playerEvents.onPlayerInteract += SetPlayerInteract;
_playerEvents.onPlayerAttack += SetPlayerAttack;
} }
} }
...@@ -60,4 +63,9 @@ public class PlayerAnimator : NetworkBehaviour ...@@ -60,4 +63,9 @@ public class PlayerAnimator : NetworkBehaviour
{ {
_animator.SetTrigger(IS_INTERACTING); _animator.SetTrigger(IS_INTERACTING);
} }
private void SetPlayerAttack()
{
_animator.CrossFade(IS_ATTACKING, 0.1f, -1, 0, 1f);
}
} }
\ No newline at end of file
using System; using System.Collections;
using DG.Tweening;
using Unity.Netcode; using Unity.Netcode;
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization;
public class PlayerController : NetworkBehaviour public class PlayerController : NetworkBehaviour
{ {
#region components
[SerializeField] private PlayerInteractionSettings playerInteractionSettings; [SerializeField] private PlayerInteractionSettings playerInteractionSettings;
[SerializeField] private float speed = 2f; [SerializeField] private float speed = 2f;
[SerializeField] private InputReader _inputReader; [SerializeField] private InputReader inputReader;
private PlayerManager _playerManager; private PlayerManager _playerManager;
private PlayerAnimator _playerAnimator; private PlayerAnimator _playerAnimator;
private Rigidbody _rb; private Rigidbody _rb;
private Camera _camera; private Camera _camera;
#endregion
#region cameraProperties
public Vector3 offset = new Vector3(0, 7.4f, -6.4f); public Vector3 offset = new Vector3(0, 7.4f, -6.4f);
public Vector3 cameraAngle = new Vector3(40.45f, 0, 0);
private Vector2 _movementInput;
public float fov = 60;
#endregion
#region movementProperties
public bool enableSprint = true; public bool enableSprint = true;
public bool unlimitedSprint = false; public bool unlimitedSprint;
public float sprintSpeed = 7f; public float sprintSpeed = 7f;
public float sprintDuration = 5f; public float sprintDuration = 5f;
public float sprintCooldown = .5f; public float sprintCooldown = .5f;
...@@ -31,46 +36,60 @@ public class PlayerController : NetworkBehaviour ...@@ -31,46 +36,60 @@ public class PlayerController : NetworkBehaviour
public bool playerCanMove = true; public bool playerCanMove = true;
public float walkSpeed = 5f; public float walkSpeed = 5f;
public bool _isWalking = false;
public float maxVelocityChange = 10f; public float maxVelocityChange = 10f;
public float fov = 60;
private bool _isWalking;
// Internal Variables // Internal Variables
private bool _isSprinting = false; private Vector2 _movementInput;
private bool _isSprinting;
private float _sprintRemaining; private float _sprintRemaining;
private bool _isSprintCooldown = false; private bool _isSprintCooldown;
private float _sprintCooldownReset; private float _sprintCooldownReset;
// Internal Variables // Internal Variables
private Vector3 _jointOriginalPos; private Vector3 _jointOriginalPos;
private float _timer = 0; private float _timer;
private float _walkingSoundTimer;
private bool _isWalkingSoundCooldown;
private float _sprintingSoundTimer;
private bool _isSprintingSoundCooldown;
private float _walkingSoundTimer = 0; #endregion
private bool _isWalkingSoundCooldown = false;
private float _sprintingSoundTimer = 0; #region attackProperties
private bool _isSprintingSoundCooldown = false;
public float hitDamage = 5f;
public float attackCooldown = 1f;
private float _attackCooldownTimer;
#endregion
private void OnEnable() private void OnEnable()
{ {
if (_inputReader != null) if (inputReader != null)
{ {
_inputReader.MoveEvent += OnMove; inputReader.MoveEvent += OnMove;
_inputReader.InteractEvent += OnInteract; inputReader.InteractEvent += OnInteract;
_inputReader.SprintEvent += OnSprint; inputReader.SprintEvent += OnSprint;
inputReader.AttackEvent += OnAttack;
} }
} }
private void OnDisable() private void OnDisable()
{ {
if (_inputReader != null) if (inputReader != null)
{ {
_inputReader.MoveEvent -= OnMove; inputReader.MoveEvent -= OnMove;
_inputReader.InteractEvent -= OnInteract; inputReader.InteractEvent -= OnInteract;
_inputReader.SprintEvent -= OnSprint; inputReader.SprintEvent -= OnSprint;
inputReader.AttackEvent -= OnAttack;
} }
} }
...@@ -111,7 +130,7 @@ public class PlayerController : NetworkBehaviour ...@@ -111,7 +130,7 @@ public class PlayerController : NetworkBehaviour
} }
_inputReader.InitializeInput(); inputReader.InitializeInput();
_rb = GetComponent<Rigidbody>(); _rb = GetComponent<Rigidbody>();
if (_rb == null) if (_rb == null)
{ {
...@@ -129,6 +148,20 @@ public class PlayerController : NetworkBehaviour ...@@ -129,6 +148,20 @@ public class PlayerController : NetworkBehaviour
_movementInput = movement; _movementInput = movement;
} }
private void OnAttack()
{
if (_attackCooldownTimer > 0) return;
Debug.Log("attack started");
HitObject();
_attackCooldownTimer = attackCooldown; // Set cooldown duration
}
private void OnInteract()
{
CheckForInteractableCollision();
}
private void Update() private void Update()
{ {
if (!IsOwner) if (!IsOwner)
...@@ -136,6 +169,11 @@ public class PlayerController : NetworkBehaviour ...@@ -136,6 +169,11 @@ public class PlayerController : NetworkBehaviour
return; return;
} }
if (_attackCooldownTimer > 0)
{
_attackCooldownTimer -= Time.deltaTime;
}
if (enableSprint) if (enableSprint)
{ {
if (_isSprinting && !_isSprintCooldown) if (_isSprinting && !_isSprintCooldown)
...@@ -274,12 +312,6 @@ public class PlayerController : NetworkBehaviour ...@@ -274,12 +312,6 @@ public class PlayerController : NetworkBehaviour
#endregion #endregion
} }
private void OnInteract()
{
Debug.Log("Interact");
CheckForInteractableCollision();
}
private void UpdateCamera() private void UpdateCamera()
{ {
...@@ -296,6 +328,7 @@ public class PlayerController : NetworkBehaviour ...@@ -296,6 +328,7 @@ public class PlayerController : NetworkBehaviour
switch (hitCollider.GetComponent<IInteractable>()) switch (hitCollider.GetComponent<IInteractable>())
{ {
case Chest chest: case Chest chest:
RotatePlayerTowardsTarget(hitCollider);
_playerManager.playerEvents.PlayerInteract(); _playerManager.playerEvents.PlayerInteract();
chest.Interact(); chest.Interact();
...@@ -304,12 +337,48 @@ public class PlayerController : NetworkBehaviour ...@@ -304,12 +337,48 @@ public class PlayerController : NetworkBehaviour
} }
} }
private void UpdateMovementBooleans() private void HitObject()
{ {
} Collider[] hitColliders = Physics.OverlapSphere(transform.position,
playerInteractionSettings.interactableRadius,
playerInteractionSettings.destructableLayer);
if (hitColliders.Length > 0)
{
Collider closestCollider = null;
float closestDistance = float.MaxValue;
public bool IsWalking() foreach (var hitCollider in hitColliders)
{
float distance = Vector3.Distance(transform.position, hitCollider.transform.position);
if (distance < closestDistance)
{
closestDistance = distance;
closestCollider = hitCollider;
}
}
if (closestCollider != null)
{
switch (closestCollider.GetComponent<IDestrucable>())
{
case Barrel barrel:
RotatePlayerTowardsTarget(closestCollider);
_playerManager.playerEvents.PlayerAttack();
barrel.TakeDamage(hitDamage);
break;
}
}
}
else
{
_playerManager.playerEvents.PlayerAttack();
}
}
private void RotatePlayerTowardsTarget(Collider hit)
{ {
return _isWalking; Vector3 direction = (hit.transform.position - transform.position).normalized;
Quaternion lookRotation = Quaternion.LookRotation(new Vector3(direction.x, 0, direction.z));
transform.DORotateQuaternion(lookRotation, 0.3f);
} }
} }
\ No newline at end of file
...@@ -4,5 +4,6 @@ using UnityEngine; ...@@ -4,5 +4,6 @@ using UnityEngine;
public class PlayerInteractionSettings : ScriptableObject public class PlayerInteractionSettings : ScriptableObject
{ {
public LayerMask interactableLayer; public LayerMask interactableLayer;
public LayerMask destructableLayer;
public float interactableRadius = 0.2f; public float interactableRadius = 0.2f;
} }
\ No newline at end of file
fileFormatVersion: 2
guid: 9b5479f2eb983ae4da0d82240e638552
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4727207244663773237
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8681228075763733043}
m_Layer: 0
m_Name: Barrel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8681228075763733043
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4727207244663773237}
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: 8877903449436891099}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &8988656382305353776
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 8681228075763733043}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
propertyPath: m_Name
value: barrel_large
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
propertyPath: m_Layer
value: 7
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
insertIndex: -1
addedObject: {fileID: 6303177976271785865}
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
insertIndex: -1
addedObject: {fileID: 5127824732359231213}
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
insertIndex: -1
addedObject: {fileID: 1580681325717503087}
m_SourcePrefab: {fileID: 100100000, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
--- !u!1 &8106328193517419873 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
m_PrefabInstance: {fileID: 8988656382305353776}
m_PrefabAsset: {fileID: 0}
--- !u!64 &6303177976271785865
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8106328193517419873}
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: 0
m_CookingOptions: 30
m_Mesh: {fileID: -4131521360128221038, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
--- !u!114 &5127824732359231213
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8106328193517419873}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ed4e03c2301e55647a46a17478fe384a, type: 3}
m_Name:
m_EditorClassIdentifier:
_destructableSettings: {fileID: 11400000, guid: 5558f512b44c7d74abf20baaba6dc9ef, type: 2}
--- !u!114 &1580681325717503087
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8106328193517419873}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier:
GlobalObjectIdHash: 0
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!4 &8877903449436891099 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e13481dedf01cb048b93d9e493c354b4, type: 3}
m_PrefabInstance: {fileID: 8988656382305353776}
m_PrefabAsset: {fileID: 0}
fileFormatVersion: 2
guid: 525df842114a50742b87e2282140ad02
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: af3b7a8c833e43940acc5f8f8bf75c73
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &334567762338569054
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 508112708245697088}
- component: {fileID: 5197348067561649398}
- component: {fileID: 3719657908984160168}
- component: {fileID: 5985337197130156648}
m_Layer: 6
m_Name: Chest
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &508112708245697088
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 334567762338569054}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalPosition: {x: -3, y: -0.74, z: -1.19}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5581039208921597645}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!65 &5197348067561649398
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 334567762338569054}
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: 3
m_Size: {x: 1, y: 1.9, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &3719657908984160168
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 334567762338569054}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier:
GlobalObjectIdHash: 41515216
InScenePlacedSourceGlobalObjectIdHash: 2566412672
DeferredDespawnTick: 0
Ownership: 1
AlwaysReplicateAsRoot: 0
SynchronizeTransform: 1
ActiveSceneSynchronization: 0
SceneMigrationSynchronization: 1
SpawnWithObservers: 1
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
SyncOwnerTransformWhenParented: 1
AllowOwnerToParent: 0
--- !u!114 &5985337197130156648
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 334567762338569054}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 63b29137fb31e5140a37424945869b1a, type: 3}
m_Name:
m_EditorClassIdentifier:
ShowTopMostFoldoutHeaderGroup: 1
--- !u!1001 &5402468981291475238
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 508112708245697088}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: d46144bdce591c245b65cf2cea064060, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d46144bdce591c245b65cf2cea064060, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d46144bdce591c245b65cf2cea064060, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d46144bdce591c245b65cf2cea064060, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d46144bdce591c245b65cf2cea064060, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d46144bdce591c245b65cf2cea064060, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d46144bdce591c245b65cf2cea064060, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d46144bdce591c245b65cf2cea064060, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d46144bdce591c245b65cf2cea064060, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d46144bdce591c245b65cf2cea064060, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: d46144bdce591c245b65cf2cea064060, type: 3}
propertyPath: m_Name
value: chest
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d46144bdce591c245b65cf2cea064060, type: 3}
--- !u!4 &5581039208921597645 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: d46144bdce591c245b65cf2cea064060, type: 3}
m_PrefabInstance: {fileID: 5402468981291475238}
m_PrefabAsset: {fileID: 0}
fileFormatVersion: 2
guid: dc502d59cef13ed40b07aa18bd1a4167
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -45,7 +45,7 @@ AnimatorStateTransition: ...@@ -45,7 +45,7 @@ AnimatorStateTransition:
m_TransitionDuration: 0.25 m_TransitionDuration: 0.25
m_TransitionOffset: 0 m_TransitionOffset: 0
m_ExitTime: 0.765625 m_ExitTime: 0.765625
m_HasExitTime: 0 m_HasExitTime: 1
m_HasFixedDuration: 1 m_HasFixedDuration: 1
m_InterruptionSource: 0 m_InterruptionSource: 0
m_OrderedInterruption: 1 m_OrderedInterruption: 1
...@@ -58,11 +58,12 @@ AnimatorState: ...@@ -58,11 +58,12 @@ AnimatorState:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Idle m_Name: Idle
m_Speed: 1 m_Speed: 2
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: m_Transitions:
- {fileID: 2561986876081676319} - {fileID: 2561986876081676319}
- {fileID: -7829200255183543722} - {fileID: -7829200255183543722}
- {fileID: -2454258677163262022}
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
...@@ -95,10 +96,13 @@ AnimatorStateMachine: ...@@ -95,10 +96,13 @@ AnimatorStateMachine:
m_Position: {x: 320, y: 120, z: 0} m_Position: {x: 320, y: 120, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 1994921182856151451} m_State: {fileID: 1994921182856151451}
m_Position: {x: -260, y: 240, z: 0} m_Position: {x: -300, y: 110, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 1041689816694880610} m_State: {fileID: 1041689816694880610}
m_Position: {x: 310, y: 220, z: 0} m_Position: {x: 310, y: 220, z: 0}
- serializedVersion: 1
m_State: {fileID: 7653408459867535690}
m_Position: {x: -300, y: 210, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: [] m_AnyStateTransitions: []
m_EntryTransitions: [] m_EntryTransitions: []
...@@ -109,6 +113,53 @@ AnimatorStateMachine: ...@@ -109,6 +113,53 @@ AnimatorStateMachine:
m_ExitPosition: {x: 1020, y: -20, z: 0} m_ExitPosition: {x: 1020, y: -20, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -6917854663193515141} m_DefaultState: {fileID: -6917854663193515141}
--- !u!1101 &-2454258677163262022
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: Attack
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 7653408459867535690}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.765625
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-896252792714425225
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
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.8076923
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-317027022489812209 --- !u!1101 &-317027022489812209
AnimatorStateTransition: AnimatorStateTransition:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
...@@ -161,6 +212,12 @@ AnimatorController: ...@@ -161,6 +212,12 @@ AnimatorController:
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 9100000}
- m_Name: Attack
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers: m_AnimatorLayers:
- serializedVersion: 5 - serializedVersion: 5
m_Name: Base Layer m_Name: Base Layer
...@@ -236,7 +293,8 @@ AnimatorState: ...@@ -236,7 +293,8 @@ AnimatorState:
m_Name: Interact m_Name: Interact
m_Speed: 1 m_Speed: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: [] m_Transitions:
- {fileID: -896252792714425225}
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
...@@ -305,3 +363,52 @@ AnimatorState: ...@@ -305,3 +363,52 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1102 &7653408459867535690
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Attack
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 8805622880493585022}
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: 3963595363326709879, guid: 239fd912fdc786a4cb361c17f68877d9, type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &8805622880493585022
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
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.765625
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
...@@ -200,7 +200,7 @@ MonoBehaviour: ...@@ -200,7 +200,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: 3775582031 GlobalObjectIdHash: 425717663
InScenePlacedSourceGlobalObjectIdHash: 425717663 InScenePlacedSourceGlobalObjectIdHash: 425717663
DeferredDespawnTick: 0 DeferredDespawnTick: 0
Ownership: 1 Ownership: 1
...@@ -228,10 +228,8 @@ MonoBehaviour: ...@@ -228,10 +228,8 @@ MonoBehaviour:
ShowTopMostFoldoutHeaderGroup: 1 ShowTopMostFoldoutHeaderGroup: 1
playerInteractionSettings: {fileID: 11400000, guid: 1bc75bcaab451a44d8a71f0189dc90f8, type: 2} playerInteractionSettings: {fileID: 11400000, guid: 1bc75bcaab451a44d8a71f0189dc90f8, type: 2}
speed: 2 speed: 2
_inputReader: {fileID: 11400000, guid: fae963ae99ce6d14d8bbcd54becb58d7, type: 2} inputReader: {fileID: 11400000, guid: fae963ae99ce6d14d8bbcd54becb58d7, type: 2}
offset: {x: 0, y: 7.4, z: -6.4} offset: {x: 0, y: 7.4, z: -6.4}
cameraAngle: {x: 40.45, y: 0, z: 0}
fov: 60
enableSprint: 1 enableSprint: 1
unlimitedSprint: 0 unlimitedSprint: 0
sprintSpeed: 12 sprintSpeed: 12
...@@ -242,8 +240,9 @@ MonoBehaviour: ...@@ -242,8 +240,9 @@ MonoBehaviour:
zoomStepTime: 5 zoomStepTime: 5
playerCanMove: 1 playerCanMove: 1
walkSpeed: 9 walkSpeed: 9
_isWalking: 0
maxVelocityChange: 10 maxVelocityChange: 10
fov: 60
hitDamage: 5
--- !u!136 &1490898689994747714 --- !u!136 &1490898689994747714
CapsuleCollider: CapsuleCollider:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -496,4 +495,11 @@ MonoBehaviour: ...@@ -496,4 +495,11 @@ MonoBehaviour:
TransitionDuration: 0.25 TransitionDuration: 0.25
TriggerNameHash: -662453572 TriggerNameHash: -662453572
TransitionIndex: 1 TransitionIndex: 1
- IsCrossFadeExit: 0
Layer: 0
OriginatingState: 2081823275
DestinationState: 1080829965
TransitionDuration: 0.25
TriggerNameHash: 1080829965
TransitionIndex: 2
m_Animator: {fileID: 6949535474896224677} m_Animator: {fileID: 6949535474896224677}
fileFormatVersion: 2
guid: a1059662c26fbc341b1d54238d756caa
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f0865dc671f389940b7c393a0a448838, type: 3}
m_Name: BarrelSettings
m_EditorClassIdentifier:
health: 20
hitDelay: 0.6
shakeOffset: {x: 0.2, y: 0, z: 0.2}
fileFormatVersion: 2
guid: 5558f512b44c7d74abf20baaba6dc9ef
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
...@@ -15,4 +15,7 @@ MonoBehaviour: ...@@ -15,4 +15,7 @@ MonoBehaviour:
interactableLayer: interactableLayer:
serializedVersion: 2 serializedVersion: 2
m_Bits: 64 m_Bits: 64
destructableLayer:
serializedVersion: 2
m_Bits: 128
interactableRadius: 2 interactableRadius: 2
...@@ -12,7 +12,7 @@ TagManager: ...@@ -12,7 +12,7 @@ TagManager:
- Water - Water
- UI - UI
- Interactable - Interactable
- - Destructable
- -
- -
- -
......
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