diff --git a/Assets/Scenes/Level_01.unity b/Assets/Scenes/Level_01.unity index 0e0a103ba86c98ec9f56fed4410a802936cbe5b6..9b4dadbd730e13dba73e496709bb8b89c42ae126 100644 --- a/Assets/Scenes/Level_01.unity +++ b/Assets/Scenes/Level_01.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.4506148, g: 0.49860865, b: 0.56437486, a: 1} + m_IndirectSpecularColor: {r: 0.45061505, g: 0.498609, b: 0.56437516, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -168,7 +168,6 @@ Transform: 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_RootOrder: 8 @@ -224,7 +223,6 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 10.9, y: 0, z: -13.45} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 13 @@ -279,7 +277,6 @@ Transform: m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 100, y: 100, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 3 @@ -316,7 +313,6 @@ Transform: 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: 114823662} m_RootOrder: 0 @@ -546,7 +542,6 @@ Transform: 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: 114823662} m_RootOrder: 3 @@ -676,7 +671,6 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -6.71, y: 0.52, z: 7.13} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 17 @@ -837,7 +831,6 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1628631203} - {fileID: 1355904404} @@ -858,7 +851,7 @@ RectTransform: m_Pivot: {x: 0, y: 0} --- !u!95 &360206200 Animator: - serializedVersion: 4 + serializedVersion: 3 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} @@ -871,7 +864,6 @@ Animator: m_UpdateMode: 0 m_ApplyRootMotion: 0 m_LinearVelocityBlending: 0 - m_StabilizeFeet: 0 m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 @@ -956,7 +948,6 @@ Transform: m_LocalRotation: {x: 0.2588191, y: 0, z: 0, w: 0.9659258} m_LocalPosition: {x: 1, y: 15, z: -22} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 @@ -1079,7 +1070,6 @@ Transform: 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_RootOrder: 12 @@ -1122,7 +1112,6 @@ Transform: m_LocalRotation: {x: 0, y: 0.8660254, z: -0, w: -0.5} m_LocalPosition: {x: 22.5, y: 0, z: 15} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 10 @@ -1221,7 +1210,6 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -6.0968103, y: -1.39, z: 0.9399986} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 18 @@ -1351,7 +1339,6 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -6.71, y: 0.52, z: 5.04} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 15 @@ -1481,7 +1468,6 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -5.2300005, y: -1.07, z: -0.88000107} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 20 @@ -1640,7 +1626,6 @@ Transform: 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_RootOrder: 4 @@ -1671,7 +1656,6 @@ Transform: m_LocalRotation: {x: 0, y: 0.9063079, z: -0, w: -0.42261827} m_LocalPosition: {x: 0, y: 0, z: 32} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 11 @@ -1704,7 +1688,6 @@ RectTransform: 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: 360206199} m_RootOrder: 4 @@ -1784,7 +1767,6 @@ RectTransform: 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: 360206199} m_RootOrder: 1 @@ -1926,7 +1908,6 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -6.71, y: 0.52, z: 2.88} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 16 @@ -1991,7 +1972,6 @@ RectTransform: 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: 360206199} m_RootOrder: 3 @@ -2083,7 +2063,6 @@ RectTransform: 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: 360206199} m_RootOrder: 6 @@ -2161,7 +2140,6 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -16.6, y: 0, z: -5.59} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 14 @@ -2434,7 +2412,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 8ec45203ae7a1a54c9d02c355f983833, type: 3} m_Name: m_EditorClassIdentifier: - speed: 6 + speedMultiplier: 1 --- !u!114 &1509913240 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2507,7 +2485,6 @@ ParticleSystemRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_RenderMode: 0 - m_MeshDistribution: 0 m_SortMode: 0 m_MinParticleSize: 0 m_MaxParticleSize: 1 @@ -2531,10 +2508,6 @@ ParticleSystemRenderer: m_Mesh1: {fileID: 0} m_Mesh2: {fileID: 0} m_Mesh3: {fileID: 0} - m_MeshWeighting: 1 - m_MeshWeighting1: 1 - m_MeshWeighting2: 1 - m_MeshWeighting3: 1 m_MaskInteraction: 0 --- !u!198 &1509913244 ParticleSystem: @@ -7328,12 +7301,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ff5a91d3c91bd124c94287976126e95f, type: 3} m_Name: m_EditorClassIdentifier: - power: 2 - speed: 6 - health: 100 - maxPower: 100 - maxSpeed: 20 - maxHealth: 200 + minPower: 1 + maxPower: 8 + minSpeed: 3 + maxSpeed: 10 + maxHealth: 1000 powerText: {fileID: 1807752955} healthText: {fileID: 2037564803} speedText: {fileID: 1451944813} @@ -7775,7 +7747,6 @@ Transform: 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: 114823662} m_RootOrder: 2 @@ -7808,7 +7779,6 @@ RectTransform: 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: 360206199} m_RootOrder: 0 @@ -7950,7 +7920,6 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -8.510001, y: -1.22, z: -0.9858322} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 19 @@ -8013,7 +7982,6 @@ Transform: 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: 114823662} m_RootOrder: 1 @@ -8145,7 +8113,6 @@ RectTransform: 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: 360206199} m_RootOrder: 7 @@ -8225,7 +8192,6 @@ RectTransform: 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: 360206199} m_RootOrder: 2 @@ -8311,6 +8277,7 @@ MonoBehaviour: HealthOrb: {fileID: 749927201} xPos: 0 zPos: 0 + orbType: 0 --- !u!4 &1908638276 Transform: m_ObjectHideFlags: 0 @@ -8321,7 +8288,6 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 13.871423, y: 2.643187, z: 33.03375} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 21 @@ -8354,7 +8320,6 @@ RectTransform: 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: 360206199} m_RootOrder: 5 @@ -8432,7 +8397,6 @@ Transform: m_LocalRotation: {x: 0, y: 0.9063079, z: 0, w: 0.42261827} m_LocalPosition: {x: -20.5, y: 0, z: 12.5} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 9 @@ -8465,7 +8429,6 @@ RectTransform: 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: 360206199} m_RootOrder: 8 @@ -8579,7 +8542,6 @@ Transform: 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_RootOrder: 7 diff --git a/Assets/Scripts/Player/PlayerAttribute.cs b/Assets/Scripts/Player/PlayerAttribute.cs index e319c446010bb1582a960102ed89e84ccf447e5f..49e5515926b47d59c2831117ba73520365f89772 100644 --- a/Assets/Scripts/Player/PlayerAttribute.cs +++ b/Assets/Scripts/Player/PlayerAttribute.cs @@ -3,13 +3,46 @@ using UnityEngine.UI; public class PlayerAttribute : MonoBehaviour { - public int power = 1; - public float speed = 6f; - public int health = 100; + public int minPower = 1; + public int maxPower = 8; + public float minSpeed = 3f; + public float maxSpeed = 10f; + public int maxHealth = 1000; + private int _power = 1; + private float _speed = 3f; + private int _health = 100; + + public int power + { + get { return _power; } + set + { + _power = value; + if (value < minPower) _power = minPower; + if (value > maxPower) _power = maxPower; + } + } + public float speed + { + get { return _speed; } + set + { + _speed = value; + if (value < minSpeed) _speed = minSpeed; + if (value > maxSpeed) _speed = maxSpeed; + } + } + + public int health + { + get { return _health; } + set + { + _health = value; + if (value > maxHealth) _health = maxHealth; + } + } - public int maxPower = 100; - public float maxSpeed = 20f; - public int maxHealth = 200; public Text powerText; public Text healthText; @@ -17,16 +50,15 @@ public class PlayerAttribute : MonoBehaviour void Start() { - } void Update() { if (health <= 0) health = 0; - powerText.text = "P: " + power.ToString(); - healthText.text = "H: " + health.ToString(); - speedText.text = "S: " + speed.ToString(); + powerText.text = "P: " + _power.ToString(); + healthText.text = "H: " + _health.ToString(); + speedText.text = "S: " + _speed.ToString(); } void UpgradePower(int amount) diff --git a/Assets/Scripts/Player/PlayerMovement.cs b/Assets/Scripts/Player/PlayerMovement.cs index 07cb1fa29a7f2193accb0177b3047f06527bb00f..6ca8467c3e49dcb4ae8188979b019da8dd74c26b 100644 --- a/Assets/Scripts/Player/PlayerMovement.cs +++ b/Assets/Scripts/Player/PlayerMovement.cs @@ -2,20 +2,21 @@ public class PlayerMovement : MonoBehaviour { - public float speed = 6f; + public float speedMultiplier = 1f; Vector3 movement; Animator anim; Rigidbody rb; int floorMask; float camRayLength = 100f; + PlayerAttribute playerAttribute; private void Awake() { floorMask = LayerMask.GetMask("Floor"); - anim = GetComponent<Animator>(); - rb = GetComponent<Rigidbody>(); + playerAttribute = GetComponent<PlayerAttribute>(); + } private void FixedUpdate() @@ -32,7 +33,7 @@ public class PlayerMovement : MonoBehaviour { movement.Set(h, 0f, v); - movement = movement.normalized * speed * Time.deltaTime; + movement = movement.normalized * speedMultiplier * playerAttribute.speed * Time.deltaTime; rb.MovePosition(transform.position + movement); } diff --git a/Assets/Scripts/Player/PlayerShooting.cs b/Assets/Scripts/Player/PlayerShooting.cs index 68c846ed9c00af184927794f6f9ea879a2a2fdbc..85f01388f56b187d235089da5ce431b90f10f5b1 100644 --- a/Assets/Scripts/Player/PlayerShooting.cs +++ b/Assets/Scripts/Player/PlayerShooting.cs @@ -54,15 +54,17 @@ public class PlayerShooting : MonoBehaviour public void DisableEffects() { - foreach (var G in gunLineList) + gunLight.enabled = false; + foreach (var G in gunLineList) { G.enabled = false; } } - public void setDirection(LineRenderer line, int degree){ + public void setDirection(LineRenderer line, int degree) + { line.SetPosition(0, gunPoint.position); - line.SetPosition(1, gunPoint.position + Quaternion.Euler(0, degree, 0) * gunPoint.forward * range ); + line.SetPosition(1, gunPoint.position + Quaternion.Euler(0, degree, 0) * gunPoint.forward * range); } void Shoot() @@ -78,7 +80,8 @@ public class PlayerShooting : MonoBehaviour gunLine.SetPosition(0, gunPoint.position); gunLineList.Add(gunLine); - if(gunDirectionLevel == 2 ){ + if (gunDirectionLevel == 2) + { gunLine2.enabled = true; setDirection(gunLine2, -23); @@ -89,7 +92,8 @@ public class PlayerShooting : MonoBehaviour gunLineList.Add(gunLine3); } - else if (gunDirectionLevel == 3){ + else if (gunDirectionLevel == 3) + { gunLine2.enabled = true; setDirection(gunLine2, -23); @@ -107,7 +111,7 @@ public class PlayerShooting : MonoBehaviour gunLineList.Add(gunLine5); } - + shootRay.origin = gunPoint.position; shootRay.direction = gunPoint.forward;