This commit is contained in:
JonatanRek 2020-02-01 23:28:39 +01:00
commit 103b6c4195
46 changed files with 10609 additions and 401 deletions

View File

@ -79,7 +79,6 @@ namespace GitHub.Unity
PluginImporter importer = AssetImporter.GetAtPath(filepath) as PluginImporter;
if (importer == null)
{
Debug.LogFormat("GitHub for Unity: Could not find importer for {0}. Some functionality may fail.", filepath);
continue;
}
if (importer.GetCompatibleWithEditor() != enable)

View File

@ -10,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
@ -46,6 +47,23 @@ MonoBehaviour:
m_EditorClassIdentifier:
blockType: 1
health: 100
healthRate: 5
amountModels: []
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: 1999182813209888360}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
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
@ -53,6 +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
@ -128,6 +167,43 @@ PrefabInstance:
propertyPath: m_Name
value: spikes
objectReference: {fileID: 0}
- target: {fileID: -113181020801827196, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 427c5d2662e5f764484aeb5e62dd64ab, type: 2}
- target: {fileID: 608615394619914483, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 427c5d2662e5f764484aeb5e62dd64ab, type: 2}
- target: {fileID: 1066910053003865102, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 427c5d2662e5f764484aeb5e62dd64ab, type: 2}
- target: {fileID: 1323765397811007978, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 427c5d2662e5f764484aeb5e62dd64ab, type: 2}
- target: {fileID: 1711277887553122256, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: -4042805660767941618, guid: c5e781ac470bf2c469882550ede67f06,
type: 3}
- target: {fileID: 4063835366044962077, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: -4042805660767941618, guid: c5e781ac470bf2c469882550ede67f06,
type: 3}
- target: {fileID: 5490870052100550915, guid: 528f4b131abb8f9498400c1cf4283eca,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 427c5d2662e5f764484aeb5e62dd64ab, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 528f4b131abb8f9498400c1cf4283eca, type: 3}
--- !u!4 &3546092385323716967 stripped

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

@ -231,28 +231,28 @@ MonoBehaviour:
health: 100
healthRate: 5
amountModels:
- {fileID: 4443642083919416725}
- {fileID: 5205200862043998919}
- {fileID: 8452048823607473439}
- {fileID: 8456627140763662303}
- {fileID: 7373073294925482436}
- {fileID: 4937171485821671441}
- {fileID: 1639123759080977681}
- {fileID: 715030014523983583}
- {fileID: 6141267715529604239}
- {fileID: 857922654142497041}
- {fileID: 4555224919543958357}
- {fileID: 8845523186980114736}
- {fileID: 6629251295739648829}
- {fileID: 2583879648814668796}
- {fileID: 5626775279250410506}
- {fileID: 3898591326953282408}
- {fileID: 2469224091592576205}
- {fileID: 6841636828864525375}
- {fileID: 8190553761067856993}
- {fileID: 1840520068144572235}
- {fileID: 2199959104259311449}
- {fileID: 8806615898572238909}
- {fileID: 2199959104259311449}
- {fileID: 1840520068144572235}
- {fileID: 8190553761067856993}
- {fileID: 6841636828864525375}
- {fileID: 2469224091592576205}
- {fileID: 3898591326953282408}
- {fileID: 5626775279250410506}
- {fileID: 2583879648814668796}
- {fileID: 6629251295739648829}
- {fileID: 8845523186980114736}
- {fileID: 4555224919543958357}
- {fileID: 857922654142497041}
- {fileID: 6141267715529604239}
- {fileID: 715030014523983583}
- {fileID: 1639123759080977681}
- {fileID: 4937171485821671441}
- {fileID: 7373073294925482436}
- {fileID: 8456627140763662303}
- {fileID: 8452048823607473439}
- {fileID: 5205200862043998919}
- {fileID: 4443642083919416725}
--- !u!65 &8296172667468284673
BoxCollider:
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

View File

@ -1497,33 +1497,33 @@ MonoBehaviour:
health: 100
healthRate: 10
amountModels:
- {fileID: 5072048420132254878}
- {fileID: 248512549599306158}
- {fileID: 6980898580401705906}
- {fileID: 1897976111086725114}
- {fileID: 8839370382815059758}
- {fileID: 8768503417553488399}
- {fileID: 2329779877516623269}
- {fileID: 6775036794450576978}
- {fileID: 6199803563995182287}
- {fileID: 6404659247269481042}
- {fileID: 4159915305215488823}
- {fileID: 9160998092549646192}
- {fileID: 3185792367686729924}
- {fileID: 4721978855144505460}
- {fileID: 7381431994624522573}
- {fileID: 618757391011973604}
- {fileID: 5882290588515455028}
- {fileID: 1381889007306692253}
- {fileID: 5548633833234765463}
- {fileID: 1003082737763468099}
- {fileID: 1090375850311900763}
- {fileID: 5396578295194344855}
- {fileID: 1585754648870115333}
- {fileID: 3278748000320003741}
- {fileID: 8487709724287121870}
- {fileID: 2697596682010262550}
- {fileID: 3682382153138045620}
- {fileID: 2697596682010262550}
- {fileID: 8487709724287121870}
- {fileID: 3278748000320003741}
- {fileID: 1585754648870115333}
- {fileID: 5396578295194344855}
- {fileID: 1090375850311900763}
- {fileID: 1003082737763468099}
- {fileID: 5548633833234765463}
- {fileID: 1381889007306692253}
- {fileID: 5882290588515455028}
- {fileID: 618757391011973604}
- {fileID: 7381431994624522573}
- {fileID: 4721978855144505460}
- {fileID: 3185792367686729924}
- {fileID: 9160998092549646192}
- {fileID: 4159915305215488823}
- {fileID: 6404659247269481042}
- {fileID: 6199803563995182287}
- {fileID: 6775036794450576978}
- {fileID: 2329779877516623269}
- {fileID: 8768503417553488399}
- {fileID: 8839370382815059758}
- {fileID: 1897976111086725114}
- {fileID: 6980898580401705906}
- {fileID: 248512549599306158}
- {fileID: 5072048420132254878}
--- !u!65 &2435173728554922900
BoxCollider:
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

@ -24,17 +24,13 @@ public class DayManager : MonoBehaviour
{
float sunRotationX = transform.localEulerAngles.x;
sunRotationX = (sunRotationX > 180) ? sunRotationX - 360 : sunRotationX;
Debug.Log(sunRotationX.ToString());
if (sunRotationX < 0 && !night)
{
Debug.Log("It is a Night");
mainSource.PlayOneShot(nigtClip);
night = true;
}
else if (sunRotationX > 0 && night)
{
Debug.Log("It is a Day");
mainSource.PlayOneShot(dayClip);
night = false;
daySurvived++;

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,13 +21,19 @@ 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;
[HideInInspector]public int selectedWeapon = 0;
public int selectedWeapon = 0;
private float selectRate = 1;
private float selectTime = 1;
// Start is called before the first frame update
void Start()
{
selectTime = selectRate;
actualHealth = health;
buildTime = buildRate;
playerCamera = GetComponentInChildren<Camera>();
@ -44,7 +50,6 @@ public class PlayerManager : MonoBehaviour
Move();
RunSwitch();
SelectWeapon();
BuildBlock();
Interact();
if (actualHealth <= 0)
@ -121,64 +126,56 @@ public class PlayerManager : MonoBehaviour
{
if (weaponList.Count > 0)
{
if (Input.mouseScrollDelta.y > 0)
{
WeaponManager weaponManager = weaponList[selectedWeapon].GetComponent<WeaponManager>();
WeaponManager weaponManager = weaponList[selectedWeapon].GetComponent<WeaponManager>();
if (weaponManager != null) {
weaponManager.player = this;
if (weaponManager != null && createWeapon != null)
Debug.Log(weaponList.Count);
if (Input.GetAxis("Mouse ScrollWheel") > 0 && selectTime < Time.time)
{
Destroy(createWeapon);
if (weaponManager != null && createWeapon != null)
{
Destroy(createWeapon);
}
}
if (weaponList.Count > selectedWeapon + 1) {
selectedWeapon++;
else if (Input.GetAxis("Mouse ScrollWheel") < 0 && selectTime < Time.time)
{
if (weaponManager != null && createWeapon != null)
{
Destroy(createWeapon);
}
}
weaponManager.player = this;
if (weaponManager != null && createWeapon == null)
{
createWeapon = Instantiate(weaponList[selectedWeapon]) as GameObject;
createWeapon.transform.parent = playerCamera.transform;
createWeapon.transform.localPosition = Vector3.zero;
createWeapon.transform.localEulerAngles = Vector3.zero;
}
}
if (Input.GetAxis("Mouse ScrollWheel") > 0 && selectTime < Time.time)
{
if (weaponList.Count - 1 > selectedWeapon)
{
selectedWeapon += 1;
}
else
{
selectedWeapon = 0;
}
selectTime = selectRate + Time.time;
}
else if (Input.mouseScrollDelta.y < 0)
else if (Input.GetAxis("Mouse ScrollWheel") < 0 && selectTime < Time.time)
{
WeaponManager weaponManager = weaponList[selectedWeapon].GetComponent<WeaponManager>();
weaponManager.player = this;
if (weaponManager != null && createWeapon != null)
{
Destroy(createWeapon);
}
if (selectedWeapon > 0)
{
selectedWeapon--;
selectedWeapon -= 1;
}
else
{
selectedWeapon = weaponList.Count - 1;
}
}
WeaponManager weaponManager2 = weaponList[selectedWeapon].GetComponent<WeaponManager>();
weaponManager2.player = this;
if (weaponManager2 != null && createWeapon == null)
{
createWeapon = Instantiate(weaponList[selectedWeapon]) as GameObject;
createWeapon.transform.parent = playerCamera.transform;
createWeapon.transform.localPosition = Vector3.zero;
createWeapon.transform.localEulerAngles = Vector3.zero;
}
}
}
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;
}
selectTime = selectRate + Time.time;
}
}
}
@ -189,13 +186,24 @@ public class PlayerManager : MonoBehaviour
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")
{
@ -214,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

@ -27,13 +27,10 @@ public class SpawnManager : MonoBehaviour
float sunRotationX = Sun.transform.localEulerAngles.x;
sunRotationX = (sunRotationX > 180) ? sunRotationX - 360 : sunRotationX;
Debug.Log(sunRotationX.ToString());
if (sunRotationX < 0)
{
Debug.Log("It is a Night");
night = true;
} else {
Debug.Log("It is a Day");
night = false;
}

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

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7f8d91a5770ab6443b2c99b393881d93
guid: a4bc1ded2b70acf489648ddcb5582411
AudioImporter:
externalObjects: {}
serializedVersion: 6

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 72ec2ad9328a37d4b8d789b695cbc654
guid: 5853aafd41bf0db4d932f5a88f387711
AudioImporter:
externalObjects: {}
serializedVersion: 6

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: cfcd7768b166fca40b7f4a93de8ccc2a
guid: 28976623b91b663428487ed8c9e505bf
AudioImporter:
externalObjects: {}
serializedVersion: 6

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: daad5edb1d417414187686c73ec027d3
guid: aeed2e0cd697ea94daeaf9c094d342c0
AudioImporter:
externalObjects: {}
serializedVersion: 6

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: b5434979af9500f45b916a32c1c17b28
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Sounds/Kill01.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: d4ff4e72509168f4fbb8fbbdb090139f
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

BIN
Assets/Sounds/Kill02.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 1531017db51cc7947979d0883d237396
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

BIN
Assets/Sounds/Kill03.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: aa87a7af50cb95443a8a2c2cf67a3bc2
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

BIN
Assets/Sounds/Moohahaha.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 19be199107e8a1d48bba536aa6c5da1d
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: dbd637c87d6302e47b3dc18075b6de89
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Assets/Sounds/You Loose.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 82c454fc5bd3770438a50747eec0fc06
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

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