commit 500

This commit is contained in:
Kotrba Filip 2020-02-01 22:54:57 +01:00
parent 42041e9a5f
commit de5d4e34a8
16 changed files with 10309 additions and 478 deletions

View File

@ -1,33 +1,5 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!64 &1802929862987333833
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 256051067918925093}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: 2212009239438826721, guid: 528f4b131abb8f9498400c1cf4283eca, type: 3}
--- !u!64 &2710415013452409851
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 965572206314881976}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: -8678823145569952518, guid: 528f4b131abb8f9498400c1cf4283eca, type: 3}
--- !u!1 &1999182813209888360
GameObject:
m_ObjectHideFlags: 0
@ -38,9 +10,10 @@ GameObject:
m_Component:
- component: {fileID: 874380372637160946}
- component: {fileID: 1908658187181555171}
- component: {fileID: 2165015337968088775}
m_Layer: 0
m_Name: Barricade
m_TagString: Untagged
m_TagString: Spikes
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@ -76,90 +49,21 @@ MonoBehaviour:
health: 100
healthRate: 5
amountModels: []
--- !u!64 &8278126805500112627
MeshCollider:
audioSource: {fileID: 0}
doorSound: {fileID: 0}
--- !u!65 &2165015337968088775
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3847955541176867416}
m_GameObject: {fileID: 1999182813209888360}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 3
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: 4493585093827132993, guid: 528f4b131abb8f9498400c1cf4283eca, type: 3}
--- !u!64 &589671193672791976
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3952444572634493808}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: 2534964839176971238, guid: 528f4b131abb8f9498400c1cf4283eca, type: 3}
--- !u!64 &413455806600404748
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4850250424701318178}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: -7387706064836869012, guid: 528f4b131abb8f9498400c1cf4283eca, type: 3}
--- !u!64 &606751798092975167
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6266030662392703044}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: -5495902117074765545, guid: 528f4b131abb8f9498400c1cf4283eca, type: 3}
--- !u!64 &4559245291351294251
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7799514952860760797}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: -5053925668127403250, guid: 528f4b131abb8f9498400c1cf4283eca, type: 3}
--- !u!64 &6352464571720791550
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9095210850575404026}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 1
m_CookingOptions: 30
m_Mesh: {fileID: 8691780276856062721, guid: 528f4b131abb8f9498400c1cf4283eca, type: 3}
serializedVersion: 2
m_Size: {x: 1, y: 0.8, z: 1}
m_Center: {x: -0.1, y: 1, z: 1.2}
--- !u!1001 &8380342326956505725
PrefabInstance:
m_ObjectHideFlags: 0
@ -167,12 +71,27 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 874380372637160946}
m_Modifications:
- target: {fileID: -8470045053010906745, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
propertyPath: m_TagString
value: Untagged
objectReference: {fileID: 0}
- target: {fileID: -6054058774237248251, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: -4042805660767941618, guid: c5e781ac470bf2c469882550ede67f06,
type: 3}
- target: {fileID: -5259225927154676129, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
propertyPath: m_TagString
value: Untagged
objectReference: {fileID: 0}
- target: {fileID: -4425609515867240179, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
propertyPath: m_TagString
value: Untagged
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
propertyPath: m_LocalPosition.x
@ -293,51 +212,3 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 8380342326956505725}
m_PrefabAsset: {fileID: 0}
--- !u!1 &6266030662392703044 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2502203975881118265, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
m_PrefabInstance: {fileID: 8380342326956505725}
m_PrefabAsset: {fileID: 0}
--- !u!1 &3847955541176867416 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4695666576454475813, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
m_PrefabInstance: {fileID: 8380342326956505725}
m_PrefabAsset: {fileID: 0}
--- !u!1 &965572206314881976 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: -492420421572216379, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
m_PrefabInstance: {fileID: 8380342326956505725}
m_PrefabAsset: {fileID: 0}
--- !u!1 &7799514952860760797 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: -7462036371361415008, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
m_PrefabInstance: {fileID: 8380342326956505725}
m_PrefabAsset: {fileID: 0}
--- !u!1 &256051067918925093 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: -594094835925579944, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
m_PrefabInstance: {fileID: 8380342326956505725}
m_PrefabAsset: {fileID: 0}
--- !u!1 &3952444572634493808 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: -4425609515867240179, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
m_PrefabInstance: {fileID: 8380342326956505725}
m_PrefabAsset: {fileID: 0}
--- !u!1 &4850250424701318178 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: -5259225927154676129, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
m_PrefabInstance: {fileID: 8380342326956505725}
m_PrefabAsset: {fileID: 0}
--- !u!1 &9095210850575404026 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: -8470045053010906745, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
m_PrefabInstance: {fileID: 8380342326956505725}
m_PrefabAsset: {fileID: 0}

View File

@ -77,7 +77,7 @@ MonoBehaviour:
offMeshLink: {fileID: 3536865177621166868}
walkPoint: {fileID: 9070811066647654375}
audioSource: {fileID: -183831788463918190}
buildSound: {fileID: 8300000, guid: 2bffca641d6de514cb3780b4b3b1497d, type: 3}
buildSound: {fileID: 8300000, guid: aeed2e0cd697ea94daeaf9c094d342c0, type: 3}
--- !u!191 &3536865177621166868
OffMeshLink:
m_ObjectHideFlags: 0

View File

@ -1,5 +1,147 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2869120797490038585
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6900128296167351179}
- component: {fileID: 5981860502065413816}
- component: {fileID: 4607742650766078089}
m_Layer: 0
m_Name: Music
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6900128296167351179
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2869120797490038585}
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_Children: []
m_Father: {fileID: 7985979212931499549}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &5981860502065413816
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2869120797490038585}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!114 &4607742650766078089
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2869120797490038585}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41e45d644c0cd4b4a8133c39c3ebcfa8, type: 3}
m_Name:
m_EditorClassIdentifier:
musicSource: {fileID: 5981860502065413816}
Music: {fileID: 8300000, guid: 2842b38130c2ae343b9372edad7281bf, type: 3}
--- !u!1 &7985979212931499537
GameObject:
m_ObjectHideFlags: 0
@ -12,9 +154,10 @@ GameObject:
- component: {fileID: 7985979212931499548}
- component: {fileID: 7985979212931499551}
- component: {fileID: 7985979212931499550}
- component: {fileID: 532783939}
m_Layer: 0
m_Name: Player
m_TagString: Untagged
m_TagString: Player
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@ -31,6 +174,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 7985979213387740674}
- {fileID: 6900128296167351179}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -50,12 +194,18 @@ MonoBehaviour:
runSpeed: 25
rotateSpeed: 5
mouseSensitive: 200
fireRate: 1
buildRate: 0.5
barricadeMaterials: 10
health: 100
actualHealth: 100
barricadeMaterials: 50
ammo: 50
weaponList:
- {fileID: 2179056336067526865, guid: 666835f3de085f9409e62598a45208bf, type: 3}
- {fileID: 1999182813209888360, guid: 7933df0606f61e94e9008c58a313b22c, type: 3}
- {fileID: 2587956328074680696, guid: 4ce5febc0b514174abbed9882322d1ed, type: 3}
spikes: {fileID: 1999182813209888360, guid: 7933df0606f61e94e9008c58a313b22c, type: 3}
spikesImage: {fileID: 21300000, guid: 4962f21e920045b47be23a8e53f5716b, type: 3}
handImage: {fileID: 21300000, guid: 53484c385de7af24a87aa73334775b28, type: 3}
guiManager: {fileID: 0}
selectedWeapon: 0
--- !u!136 &7985979212931499551
CapsuleCollider:
@ -85,8 +235,104 @@ Rigidbody:
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 80
m_Constraints: 112
m_CollisionDetection: 0
--- !u!82 &532783939
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7985979212931499537}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!1 &7985979213387740679
GameObject:
m_ObjectHideFlags: 0

View File

@ -103,12 +103,12 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1536441874634436466}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.59, y: 5.88, z: -0.46}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.50999993, y: 5.8799996, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 5775934073915093630}
m_RootOrder: 13
m_Father: {fileID: 1536441875314504554}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &1536441874634436464
Light:
@ -199,7 +199,8 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1.1, y: 0, z: -0.46}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Children:
- {fileID: 1536441874634436467}
m_Father: {fileID: 5775934073915093630}
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -5598,7 +5599,6 @@ Transform:
- {fileID: 8748430584259128778}
- {fileID: 7473507513661851282}
- {fileID: 1536441875314504554}
- {fileID: 1536441874634436467}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -5617,6 +5617,9 @@ MonoBehaviour:
blockType: 5
health: 100
healthRate: 5
amountModels: []
audioSource: {fileID: 0}
doorSound: {fileID: 0}
--- !u!1 &7816027402426589345
GameObject:
m_ObjectHideFlags: 0

View File

@ -148,7 +148,7 @@ MonoBehaviour:
healthRate: 5
amountModels: []
audioSource: {fileID: -2813215890939452537}
doorSound: {fileID: 8300000, guid: 2d61bf54062da3843bc9fa509ef34673, type: 3}
doorSound: {fileID: 8300000, guid: b5434979af9500f45b916a32c1c17b28, type: 3}
--- !u!82 &-2813215890939452537
AudioSource:
m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

@ -132,4 +132,21 @@ public class BlockManager : MonoBehaviour
}
}
}
void OnTriggerEnter(Collider collider)
{
if (blockType == BlockType.Barricade) {
Debug.Log(collider.transform.tag);
if (collider.transform.CompareTag("Enemy"))
{
EnemyManager enemyManager = collider.transform.GetComponent<EnemyManager>();
if (enemyManager != null)
{
enemyManager.Damage(100);
health = 0;
Destroy(this.gameObject, 3);
}
}
}
}
}

View File

@ -47,7 +47,7 @@ public class EnemyManager : MonoBehaviour
void FixedUpdate()
{
if (navMeshAgent.pathStatus == NavMeshPathStatus.PathComplete)
if (navMeshAgent != null && navMeshAgent.pathStatus == NavMeshPathStatus.PathComplete)
{
if (actualHealth > 0 && barricadeManager == null)
{
@ -64,11 +64,17 @@ public class EnemyManager : MonoBehaviour
}
}
public void Damage()
public void Damage(float damageLoc = 0)
{
WeaponManager weaponManager = player.weaponList[player.selectedWeapon].GetComponent<WeaponManager>();
if (weaponManager != null) {
actualHealth -= weaponManager.damage;
if (damageLoc == 0) {
WeaponManager weaponManager = player.weaponList[player.selectedWeapon].GetComponent<WeaponManager>();
if (weaponManager != null) {
actualHealth -= weaponManager.damage;
}
}
else
{
actualHealth -= damageLoc;
}
}
@ -153,7 +159,7 @@ public class EnemyManager : MonoBehaviour
void Attack()
{
RaycastHit hit;
if (Physics.Raycast(transform.position + new Vector3(0,0.5f,0),transform.forward,out hit,2) && attackTime <= Time.time)
if (Physics.Raycast(transform.position + new Vector3(0,0.5f,0),transform.forward,out hit,1.5f) && attackTime <= Time.time)
{
if (hit.transform.CompareTag("Player"))
{
@ -182,10 +188,14 @@ public class EnemyManager : MonoBehaviour
void OnTriggerEnter(Collider collider)
{
Debug.Log(collider.transform.tag);
if (collider.transform.CompareTag("Meele"))
{
Damage();
WeaponManager weaponManager = collider.transform.GetComponent<WeaponManager>();
if (weaponManager != null && weaponManager.hit) {
Damage();
weaponManager.hit = false;
}
}
}
}

View File

@ -21,8 +21,12 @@ public class GuiManager : MonoBehaviour
}
public void InteractVerifier(bool set)
public void InteractVerifier(bool set, Sprite image = null)
{
InteractIcon.SetActive(set);
if (image != null)
{
InteractIcon.GetComponent<Image>().sprite = image;
}
}
}

View File

@ -0,0 +1,43 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NightDayParticles : MonoBehaviour
{
public GameObject parentParticle;
public bool activeInDay = false;
public bool activeInNight = false;
public DayManager dayManager;
bool night = false;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
float sunRotationX = dayManager.transform.localEulerAngles.x;
sunRotationX = (sunRotationX > 180) ? sunRotationX - 360 : sunRotationX;
if (sunRotationX < 0 && !night)
{
night = true;
}
else if (sunRotationX > 0 && night)
{
night = false;
}
if ((activeInDay && !night) || (activeInNight && night))
{
parentParticle.SetActive(true);
}
else
{
parentParticle.SetActive(false);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b0314a14d6c40f643bdaaf2fb3e0228d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -21,6 +21,9 @@ public class PlayerManager : MonoBehaviour
public int ammo = 50;
public List<GameObject> weaponList = new List<GameObject>();
private GameObject createWeapon;
public GameObject spikes;
public Sprite spikesImage;
public Sprite handImage;
public GuiManager guiManager;
public int selectedWeapon = 0;
private float selectRate = 1;
@ -47,7 +50,6 @@ public class PlayerManager : MonoBehaviour
Move();
RunSwitch();
SelectWeapon();
BuildBlock();
Interact();
if (actualHealth <= 0)
@ -178,36 +180,30 @@ public class PlayerManager : MonoBehaviour
}
}
void BuildBlock ()
{
if (Input.GetAxisRaw("Fire1") > 0 && buildTime < Time.time && weaponList.Count > 0)
{
Ray ray = playerCamera.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, Mathf.Infinity, LayerMask.GetMask("BuildPlace")))
{
BlockManager blockManager = weaponList[selectedWeapon].GetComponent<BlockManager>();
if (blockManager != null) {
Instantiate(weaponList[selectedWeapon], hit.point, transform.rotation);
buildTime = buildRate + Time.time;
}
}
}
}
void Interact()
{
Ray ray = playerCamera.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, 2))
{
if (hit.transform.CompareTag("BarricadeField") || hit.transform.CompareTag("Interact"))
if (hit.transform.CompareTag("BarricadeField") || hit.transform.CompareTag("Interact") || hit.transform.gameObject.layer == LayerMask.NameToLayer("BuildPlace"))
{
guiManager.InteractVerifier(true);
BlockManager blockManager = hit.transform.GetComponent<BlockManager>();
if (blockManager == null || blockManager.blockType != BlockManager.BlockType.Barricade) {
guiManager.InteractVerifier(true, handImage);
if (hit.transform.gameObject.layer == LayerMask.NameToLayer("BuildPlace"))
{
guiManager.InteractVerifier(true, spikesImage);
}
}
else
{
guiManager.InteractVerifier(false, handImage);
}
}
else
{
guiManager.InteractVerifier(false);
guiManager.InteractVerifier(false, handImage);
}
if (Input.GetAxisRaw("Build") > 0 && buildTime < Time.time && barricadeMaterials > 0 && hit.transform.tag == "BarricadeField")
{
@ -226,7 +222,15 @@ public class PlayerManager : MonoBehaviour
{
BlockManager blockManager = hit.transform.GetComponent<BlockManager>();
blockManager.Action();
}
else if (hit.transform.gameObject.layer == LayerMask.NameToLayer("BuildPlace") && Input.GetKeyDown(KeyCode.E) && buildTime < Time.time)
{
BlockManager blockManager = spikes.GetComponent<BlockManager>();
if (blockManager != null)
{
Instantiate<GameObject>(spikes, hit.point, transform.rotation);
buildTime = buildRate + Time.time;
}
}
}
else

View File

@ -47,19 +47,15 @@ public class WeaponManager : MonoBehaviour
}
else if (weaponType == WeaponType.Meele)
{
hit = true;
animator.ResetTrigger("Hit");
animator.SetTrigger("Hit");
fireTime = fireRate + Time.time;
}
}
}
void Hit_Enemy_Start()
{
hit = true;
}
void Hit_Enemy_End()
{
hit = false;
if (fireTime <= Time.time)
{
hit = false;
}
}
}

View File

@ -6,7 +6,7 @@ TextureImporter:
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 1
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
@ -31,16 +31,16 @@ TextureImporter:
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
filterMode: 0
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
@ -49,9 +49,9 @@ TextureImporter:
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
@ -70,13 +70,61 @@ TextureImporter:
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:

View File

@ -9,6 +9,7 @@ TagManager:
- Enemy
- Interact
- Meele
- Spikes
layers:
- Default
- TransparentFX