Add amo and change baricade health

This commit is contained in:
Kotrba Filip 2020-02-01 18:53:28 +01:00
parent 3dce0a34af
commit 1e7c1284fc
13 changed files with 3036 additions and 44 deletions

Binary file not shown.

View File

@ -0,0 +1,78 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Water
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _GlossMapScale: 1
- _Glossiness: 0.573
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 3
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 0.1009256, g: 0.53616506, b: 0.7924528, a: 0.8784314}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6bfb0430c355cf540baac66bb0bb8414
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,63 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &729622562892873163
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1064119418816636838}
m_Layer: 0
m_Name: SpawnPoint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1064119418816636838
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 729622562892873163}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 24.16, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 5916428261175552474}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &4511740596018407063
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5916428261175552474}
m_Layer: 0
m_Name: Point
m_TagString: Untagged
m_Icon: {fileID: -5397416234189338067, guid: 0000000000000000d000000000000000, type: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5916428261175552474
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4511740596018407063}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1064119418816636838}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d2947b7cd556cb74f84ecd7339936f32
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 52aecb86af67bc64782a3b7bece87dfd
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -36,8 +36,8 @@ public class BarricadeManager : MonoBehaviour
public void addPlank() public void addPlank()
{ {
if (health < (barricadePlanks.Count * 10)) { if (health < (barricadePlanks.Count * 50)) {
health += 10; health += 50;
offMeshLink.enabled = false; offMeshLink.enabled = false;
} }
} }
@ -55,7 +55,7 @@ public class BarricadeManager : MonoBehaviour
{ {
for (int i = 0; i < barricadePlanks.Count; i++) for (int i = 0; i < barricadePlanks.Count; i++)
{ {
if (i < (health / 10)) { if (i < (health / 50)) {
barricadePlanks[i].SetActive(true); barricadePlanks[i].SetActive(true);
} }
else else

View File

@ -25,6 +25,10 @@ public class BlockManager : MonoBehaviour
{ {
healthTime = healthRate; healthTime = healthRate;
} }
else if (blockType == BlockType.Ammo)
{
healthTime = healthRate;
}
} }
// Update is called once per frame // Update is called once per frame
@ -38,6 +42,14 @@ public class BlockManager : MonoBehaviour
healthTime = healthRate + Time.time; healthTime = healthRate + Time.time;
} }
} }
else if (blockType == BlockType.Ammo)
{
if (health < 100 && healthTime < Time.time)
{
health += 10;
healthTime = healthRate + Time.time;
}
}
} }
public void Action() public void Action()
@ -68,5 +80,13 @@ public class BlockManager : MonoBehaviour
player.barricadeMaterials += (player.barricadeMaterials <= 40 ? 10 : (50 - player.barricadeMaterials)); player.barricadeMaterials += (player.barricadeMaterials <= 40 ? 10 : (50 - player.barricadeMaterials));
} }
} }
else if (blockType == BlockType.Ammo)
{
if (health > 0 && player.ammo < 50)
{
health -= 10;
player.ammo += (player.ammo <= 40 ? 10 : (50 - player.ammo));
}
}
} }
} }

View File

@ -17,7 +17,8 @@ public class PlayerManager : MonoBehaviour
private bool run = false; private bool run = false;
private Camera playerCamera; private Camera playerCamera;
private Rigidbody rigidBody; private Rigidbody rigidBody;
public int barricadeMaterials = 10; public int barricadeMaterials = 50;
public int ammo = 50;
public List<GameObject> weaponList = new List<GameObject>(); public List<GameObject> weaponList = new List<GameObject>();
private GameObject createWeapon; private GameObject createWeapon;
public GuiManager guiManager; public GuiManager guiManager;