Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (10)
Showing
with 476 additions and 2 deletions
......@@ -4373,6 +4373,7 @@ MonoBehaviour:
nextButtonCanvas: {fileID: 925634760}
confirmationCanvas: {fileID: 840882473}
saveFileCanvas: {fileID: 307935221}
statisticsCanvas: {fileID: 0}
--- !u!1 &543183295
GameObject:
m_ObjectHideFlags: 0
......@@ -18070,6 +18071,10 @@ PrefabInstance:
propertyPath: m_Name
value: DropLootDamage
objectReference: {fileID: 0}
- target: {fileID: 2456408812728333572, guid: 2a0d87a75ce834a47abbb5148568bc96, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3650052700995609426, guid: 2a0d87a75ce834a47abbb5148568bc96, type: 3}
propertyPath: Target
value:
......@@ -18220,6 +18225,10 @@ PrefabInstance:
propertyPath: m_Name
value: DropLootHealth
objectReference: {fileID: 0}
- target: {fileID: 2230256781738153086, guid: 29bfe8a4b5e442943950ecba6d812dad, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2888127330787397467, guid: 29bfe8a4b5e442943950ecba6d812dad, type: 3}
propertyPath: m_LocalPosition.x
value: 1.37
......@@ -18333,6 +18342,10 @@ PrefabInstance:
propertyPath: m_Name
value: DropLootSpeed
objectReference: {fileID: 0}
- target: {fileID: 8571611032601786641, guid: b811b54c1e8b7a940b8eba567ad9df64, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
......
......@@ -4063,6 +4063,8 @@ MonoBehaviour:
settingsCanvas: {fileID: 547012555}
statisticsCanvas: {fileID: 1654839518}
playtime: {fileID: 249733689}
statisticsPanel: {fileID: 64339434}
shootAccuracyText: {fileID: 1793447013}
--- !u!114 &1052050027
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -7406,6 +7408,140 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1786002137}
m_CullTransparentMesh: 1
--- !u!1 &1793447012
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1793447015}
- component: {fileID: 1793447014}
- component: {fileID: 1793447013}
m_Layer: 5
m_Name: ShootAccuraacyText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1793447013
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1793447012}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Score :'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &1793447014
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1793447012}
m_CullTransparentMesh: 1
--- !u!224 &1793447015
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1793447012}
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: 1886923669}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 143}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1857230669
GameObject:
m_ObjectHideFlags: 0
......@@ -7539,6 +7675,56 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1857230669}
m_CullTransparentMesh: 1
--- !u!1 &1886923668
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1886923669}
- component: {fileID: 1886923670}
m_Layer: 5
m_Name: Content
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1886923669
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1886923668}
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: 1793447015}
m_Father: {fileID: 1978127427}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 10, y: 0}
m_SizeDelta: {x: -800, y: -400}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1886923670
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1886923668}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c3bc780a0e43d484bb90e1a8cf098b13, type: 3}
m_Name:
m_EditorClassIdentifier:
shootAccuracyText: {fileID: 1274142208070433777, guid: 9266beedda7b1cc488a20f1a21ea96bd, type: 3}
--- !u!1 &1914918632
GameObject:
m_ObjectHideFlags: 0
......
......@@ -119,7 +119,8 @@ namespace Nightmare
QuestManager.AddEnemy(this.gameObject);
//aktifin efek drop looting
Instantiate(DropLootPrefabs, transform.position + new Vector3(0,1), Quaternion.identity);
GameObject dropLootInstance = Instantiate(DropLootPrefabs, transform.position + new Vector3(0,1), Quaternion.identity);
Destroy(dropLootInstance, 5f);
}
public void StartSinking ()
......
......@@ -254,4 +254,16 @@ public class CurrentStateData
{
return (_currentGameData.petGodMode);
}
public static int GetCurrentShootAccuracy()
{
return _currentGameData.currentShootAccuracy;
}
public static int SetCurrentShootAccuracy(int shootInTarget, int shootOutTarget )
{
float accuracy = (shootInTarget / shootOutTarget) * 100.0f;
float roundedAccuracy = Mathf.Floor(accuracy);
_currentGameData.currentShootAccuracy = (int)roundedAccuracy;
return _currentGameData.currentShootAccuracy;
}
}
\ No newline at end of file
......@@ -16,6 +16,8 @@ public class MainMenuManager : MonoBehaviour
public GameObject settingsCanvas;
public GameObject statisticsCanvas;
public TMP_Text playtime;
public GameObject statisticsPanel;
public TMP_Text shootAccuracyText;
private void Awake()
{
......@@ -108,6 +110,27 @@ public class MainMenuManager : MonoBehaviour
loadCanvas.SetActive(false);
statisticsCanvas.SetActive(true);
settingsCanvas.SetActive(false);
var saveEntries = CurrentStateData.GetSaveEntries();
//shootAccuracyText.text = "Score : " + saveEntries[-1].currentShootAccuracy.ToString() + "%";
//shootAccuracyText.text = "Score : " + CurrentStateData.GetCurrentShootAccuracy().ToString() + "%";
//textsStats.text = saveEntries.saveDateTime.ToString() + " WIB";
if (saveEntries != null && saveEntries.Length > 0)
{
// Get the last SaveEntry in the array
SaveEntry lastSaveEntry = saveEntries[saveEntries.Length - 1];
// Set the shootAccuracyText to display the currentShootAccuracy
shootAccuracyText.text = "Score : " + lastSaveEntry.currentShootAccuracy.ToString() + "%";
}
else
{
// Handle case where saveEntries array is null or empty
shootAccuracyText.text = "Score : N/A"; // Display a default value or error message
Debug.LogWarning("No save entries found or array is empty.");
}
}
public void CloseStatistic()
......
......@@ -11,12 +11,14 @@ namespace Nightmare
public GameObject nextButtonCanvas;
public GameObject confirmationCanvas;
public GameObject saveFileCanvas;
public GameObject statisticsCanvas;
public void NextSceneButton()
{
nextButtonCanvas.SetActive(false);
confirmationCanvas.SetActive(true);
saveFileCanvas.SetActive(false);
statisticsCanvas.SetActive(true);
}
public void CancelNextButton()
......@@ -24,6 +26,7 @@ namespace Nightmare
nextButtonCanvas.SetActive(true);
confirmationCanvas.SetActive(false);
saveFileCanvas.SetActive(false);
statisticsCanvas.SetActive(false);
}
public void NextWithoutSave()
......@@ -39,6 +42,7 @@ namespace Nightmare
confirmationCanvas.SetActive(false);
saveFileCanvas.SetActive(true);
nextButtonCanvas.SetActive(false);
statisticsCanvas.SetActive(false);
}
}
}
\ No newline at end of file
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace Nightmare {
public class StatisticsCanvasManager : MonoBehaviour
{
/*public TMP_Text shootAccuracyText;*/
/* public void GetShootAccuracy()
{
int _receivedShootInTarget = PlayerShooting._shootInTarget;
int _receveidShootOutTarget = PlayerShooting._shootOutTarget;
int _shootAccuracy = (_receivedShootInTarget / _receveidShootOutTarget) * 100;
CurrentStateData.SetCurrentShootAccuracy(_shootAccuracy);
shootAccuracyText.text = CurrentStateData.GetCurrentShootAccuracy().ToString();
}*/
}
}
fileFormatVersion: 2
guid: c3bc780a0e43d484bb90e1a8cf098b13
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -26,6 +26,8 @@ namespace Nightmare
float effectsDisplayTime = 0.2f;
int grenadeStock = 99;
public bool oneHit = false;
public static int _shootInTarget;
public static int _shootOutTarget;
private UnityAction listener;
......@@ -155,6 +157,10 @@ namespace Nightmare
// ... the enemy should take damage based on the damage.
enemyHealth.TakeDamage(Mathf.RoundToInt(damagePerShot * CurrentStateData.GetMultiplier()), shootHit.point);
}
_shootInTarget += 1;
Debug.Log("Shoot on Target : " + _shootInTarget);
}
// Set the second position of the line renderer to the point the raycast hit.
......@@ -166,6 +172,10 @@ namespace Nightmare
// ... set the second position of the line renderer to the fullest extent of the gun's range.
gunLine.SetPosition (1, shootRay.origin + shootRay.direction * range);
}
_shootOutTarget += 1;
CurrentStateData.SetCurrentShootAccuracy(_shootInTarget, _shootOutTarget);
Debug.Log("Anda tidak mengenai target : " + _shootOutTarget);
Debug.Log("Accuracy : " + CurrentStateData.GetCurrentShootAccuracy());
}
private void ChangeGunLine(float midPoint)
......
......@@ -17,7 +17,7 @@ namespace Nightmare
{
//Debug.Log("Anda memasuki area");
Pickup(other);
Debug.Log("Damage shot anda :" + PlayerShooting.damagePerShot);
//Debug.Log("Damage shot anda :" + PlayerShooting.damagePerShot);
}
......
fileFormatVersion: 2
guid: 5f91ca4eb16402646889c81c9d9b4ee3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &5023658776569483927
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 243333824829638858}
- component: {fileID: 8608711871479470980}
- component: {fileID: 1274142208070433777}
m_Layer: 5
m_Name: ShotAccuracyText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &243333824829638858
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5023658776569483927}
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}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 20, y: 155}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8608711871479470980
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5023658776569483927}
m_CullTransparentMesh: 1
--- !u!114 &1274142208070433777
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5023658776569483927}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Score : '
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 125cb55b44b24c4393181402bc6200e6, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: 125cb55b44b24c4393181402bc6200e6, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 50
m_fontSizeBase: 50
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
fileFormatVersion: 2
guid: 9266beedda7b1cc488a20f1a21ea96bd
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -13,4 +13,6 @@ public struct GameData
public int currentWeapon;
public bool[] weapons;
public float dmgMultiplier;
public int currentPetHealth;
public int currentShootAccuracy;
}
\ No newline at end of file
......@@ -15,4 +15,5 @@ public struct SaveEntry
public bool petGodMode;
public int currentWeapon;
public bool[] weapons;
public int currentShootAccuracy;
}
\ No newline at end of file