we used to KILL people WITH HAMMERS for saying things like that
This commit is contained in:
parent
17b1a1e367
commit
daf3218043
8 changed files with 235 additions and 54 deletions
|
|
@ -1,48 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &8120255683806130734
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 249869374080430447}
|
||||
- component: {fileID: 7808092982301890633}
|
||||
m_Layer: 0
|
||||
m_Name: DangoMallet
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &249869374080430447
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8120255683806130734}
|
||||
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: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &7808092982301890633
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8120255683806130734}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6f675ec09a8210538b466e213a2c2bba, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
weaponName: Dango Mallet
|
||||
thisEntity: {fileID: 0}
|
||||
190
Assets/Prefabs/MochiMallet.prefab
Normal file
190
Assets/Prefabs/MochiMallet.prefab
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &8120255683806130734
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 249869374080430447}
|
||||
- component: {fileID: 7808092982301890633}
|
||||
- component: {fileID: 8261414852158774365}
|
||||
m_Layer: 9
|
||||
m_Name: MochiMallet
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &249869374080430447
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8120255683806130734}
|
||||
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: 7125647062579657638}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &7808092982301890633
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8120255683806130734}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6f675ec09a8210538b466e213a2c2bba, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
weaponName: Mochi Mallet
|
||||
isAiming: 0
|
||||
thisEntity: {fileID: 0}
|
||||
damage: 30
|
||||
entityLayer:
|
||||
serializedVersion: 2
|
||||
m_Bits: 128
|
||||
debugColliderHitbox: {fileID: 8695371850973158353}
|
||||
colliderSize: {x: 2, y: 0.9}
|
||||
--- !u!61 &8261414852158774365
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8120255683806130734}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 1
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 1.5, y: 0}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0, y: 0}
|
||||
oldSize: {x: 0, y: 0}
|
||||
newSize: {x: 0, y: 0}
|
||||
adaptiveTilingThreshold: 0
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 2, y: 0.9}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1 &8695371850973158353
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7125647062579657638}
|
||||
- component: {fileID: 2215041865402522050}
|
||||
m_Layer: 9
|
||||
m_Name: Square
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!4 &7125647062579657638
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8695371850973158353}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 1.5, y: 0, z: 0}
|
||||
m_LocalScale: {x: 2, y: 0.9, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 249869374080430447}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &2215041865402522050
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8695371850973158353}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
|
|
@ -146,7 +146,8 @@ public class ActionUIHandler : MonoBehaviour
|
|||
public void SelectWeapon(Weapon weaponSelected)
|
||||
{
|
||||
MoveAction();
|
||||
selectedEntity.currentWeapon = weaponSelected;
|
||||
selectedEntity.SwitchWeapon(weaponSelected);
|
||||
HideWeaponList();
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,48 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Core.Extensions;
|
||||
using UnityEngine;
|
||||
|
||||
public class MeleeWeapon : Weapon
|
||||
{
|
||||
|
||||
public LayerMask entityLayer;
|
||||
[SerializeField] private GameObject debugColliderHitbox;
|
||||
[SerializeField] private Vector2 colliderSize;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (isAiming)
|
||||
{
|
||||
Vector2 mouseWorldPos = PlayerEntityMovement.instance.mouseWorldPos; //using this so i don't have to paste in and recalculate the variable on something i already have lol
|
||||
debugColliderHitbox.gameObject.SetActive(true);
|
||||
transform.Lookat2D(mouseWorldPos);
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
RaycastHit2D[] enemyList = Physics2D.BoxCastAll(transform.position, colliderSize, Vector3.Angle(transform.position, mouseWorldPos),
|
||||
PlayerEntityMovement.instance.mouseWorldPos, 100f, entityLayer);
|
||||
foreach (RaycastHit2D enemy in enemyList)
|
||||
{
|
||||
if (!enemy.transform.CompareTag(tag) && enemy.transform.TryGetComponent(out Entity isEntity))
|
||||
{
|
||||
isEntity.TakeDamage(damage);
|
||||
}
|
||||
}
|
||||
isAiming = false;
|
||||
thisEntity.hasAttacked = true;
|
||||
TurnHandler.instance.UpdateTurns();
|
||||
ActionUIHandler.instance.UpdateUI();
|
||||
debugColliderHitbox.gameObject.SetActive(false);
|
||||
}
|
||||
else if (Input.GetMouseButtonDown(1))
|
||||
{
|
||||
isAiming = false;
|
||||
debugColliderHitbox.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void AttackEffects()
|
||||
{
|
||||
|
||||
isAiming = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class PlayerEntityMovement : MonoBehaviour
|
|||
public GameObject templateObject;
|
||||
public bool isMoving;
|
||||
|
||||
private Vector3 mouseWorldPos;
|
||||
[HideInInspector] public Vector3 mouseWorldPos;
|
||||
private Vector3 mouseGridPos;
|
||||
private Camera cam;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,4 +53,4 @@ Physics2DSettings:
|
|||
m_ReuseCollisionCallbacks: 1
|
||||
m_AutoSyncTransforms: 0
|
||||
m_GizmoOptions: 10
|
||||
m_LayerCollisionMatrix: 2000000000000000000000000001000000000000010000000000000080010000880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
m_LayerCollisionMatrix: 2000000000000000000000000001000000000000010000000000000080030000880000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ TagManager:
|
|||
- Tile
|
||||
- Entity
|
||||
- Projectile
|
||||
-
|
||||
- WeaponHitbox
|
||||
-
|
||||
-
|
||||
-
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue