소스 검색

updated enemy mesh, prefab, started attack of players

DasGewehr 9 년 전
부모
커밋
ab60b05afe

BIN
game/Assets/3DArt/Enemy.fbx


+ 80 - 55
game/Assets/3DArt/Enemy.fbx.meta

@@ -1,72 +1,97 @@
 fileFormatVersion: 2
-guid: 0374fa6ad7f69b04f8ca0d296d213a92
-timeCreated: 1501422318
-licenseType: Pro
+guid: e3361cd0f09938f408c722a0bc8509e7
+timeCreated: 1501436825
+licenseType: Free
 ModelImporter:
   serializedVersion: 21
   fileIDToRecycleName:
     100000: Battery
     100002: BatteryHolder
     100004: Body
-    100006: //RootNode
-    100008: LeftBackEye
-    100010: LeftBackLeg
-    100012: LeftFrontEye
-    100014: LeftFrontLeg
-    100016: RightBackEye
-    100018: RightBackLeg
-    100020: RightFrontEye
-    100022: RightFrontLeg
-    100024: Sting
+    100006: Body.008
+    100008: Body.009
+    100010: Body.011
+    100012: Body.012
+    100014: Body.013
+    100016: Cube
+    100018: //RootNode
+    100020: LeftBackLeg
+    100022: LeftFrontLeg
+    100024: RightBackLeg
+    100026: RightFrontEye
+    100028: RightFrontEye.001
+    100030: RightFrontEye.002
+    100032: RightFrontLeg
+    100034: Sting
     400000: Battery
     400002: BatteryHolder
     400004: Body
-    400006: //RootNode
-    400008: LeftBackEye
-    400010: LeftBackLeg
-    400012: LeftFrontEye
-    400014: LeftFrontLeg
-    400016: RightBackEye
-    400018: RightBackLeg
-    400020: RightFrontEye
-    400022: RightFrontLeg
-    400024: Sting
+    400006: Body.008
+    400008: Body.009
+    400010: Body.011
+    400012: Body.012
+    400014: Body.013
+    400016: Cube
+    400018: //RootNode
+    400020: LeftBackLeg
+    400022: LeftFrontLeg
+    400024: RightBackLeg
+    400026: RightFrontEye
+    400028: RightFrontEye.001
+    400030: RightFrontEye.002
+    400032: RightFrontLeg
+    400034: Sting
     2300000: Battery
     2300002: BatteryHolder
     2300004: Body
-    2300006: LeftBackEye
-    2300008: LeftBackLeg
-    2300010: LeftFrontEye
-    2300012: LeftFrontLeg
-    2300014: RightBackEye
-    2300016: RightBackLeg
-    2300018: RightFrontEye
-    2300020: RightFrontLeg
-    2300022: Sting
+    2300006: Body.008
+    2300008: Body.009
+    2300010: Body.011
+    2300012: Body.012
+    2300014: Body.013
+    2300016: Cube
+    2300018: LeftBackLeg
+    2300020: LeftFrontLeg
+    2300022: RightBackLeg
+    2300024: RightFrontEye
+    2300026: RightFrontEye.001
+    2300028: RightFrontEye.002
+    2300030: RightFrontLeg
+    2300032: Sting
     3300000: Battery
     3300002: BatteryHolder
     3300004: Body
-    3300006: LeftBackEye
-    3300008: LeftBackLeg
-    3300010: LeftFrontEye
-    3300012: LeftFrontLeg
-    3300014: RightBackEye
-    3300016: RightBackLeg
-    3300018: RightFrontEye
-    3300020: RightFrontLeg
-    3300022: Sting
-    4300000: Sting
-    4300002: Battery
-    4300004: BatteryHolder
-    4300006: LeftBackEye
-    4300008: LeftFrontEye
-    4300010: RightFrontEye
-    4300012: RightBackEye
-    4300014: RightBackLeg
-    4300016: RightFrontLeg
-    4300018: LeftBackLeg
-    4300020: LeftFrontLeg
-    4300022: Body
+    3300006: Body.008
+    3300008: Body.009
+    3300010: Body.011
+    3300012: Body.012
+    3300014: Body.013
+    3300016: Cube
+    3300018: LeftBackLeg
+    3300020: LeftFrontLeg
+    3300022: RightBackLeg
+    3300024: RightFrontEye
+    3300026: RightFrontEye.001
+    3300028: RightFrontEye.002
+    3300030: RightFrontLeg
+    3300032: Sting
+    4300000: RightFrontEye.002
+    4300002: RightFrontEye.001
+    4300004: Cube
+    4300006: Body.013
+    4300008: Body.012
+    4300010: Body.011
+    4300012: Body.009
+    4300014: Body.008
+    4300016: Sting
+    4300018: Battery
+    4300020: BatteryHolder
+    4300022: RightFrontEye
+    4300024: RightBackLeg
+    4300026: RightFrontLeg
+    4300028: LeftBackLeg
+    4300030: LeftFrontLeg
+    4300032: Body
   materials:
     importMaterials: 1
     materialName: 0
@@ -99,8 +124,8 @@ ModelImporter:
     addColliders: 0
     importVisibility: 1
     importBlendShapes: 1
-    importCameras: 0
-    importLights: 0
+    importCameras: 1
+    importLights: 1
     swapUVChannels: 0
     generateSecondaryUV: 0
     useFileUnits: 1

+ 76 - 0
game/Assets/Materials/No Name.mat

@@ -0,0 +1,76 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 6
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_Name: No Name
+  m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
+  m_ShaderKeywords: 
+  m_LightmapFlags: 4
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  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: 0
+    - _GlossMapScale: 1
+    - _Glossiness: 0.5
+    - _GlossyReflections: 1
+    - _Metallic: 0
+    - _Mode: 0
+    - _OcclusionStrength: 1
+    - _Parallax: 0.02
+    - _SmoothnessTextureChannel: 0
+    - _SpecularHighlights: 1
+    - _SrcBlend: 1
+    - _UVSec: 0
+    - _ZWrite: 1
+    m_Colors:
+    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

+ 9 - 0
game/Assets/Materials/No Name.mat.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: d95cce7178eef5f4b93405e168213b99
+timeCreated: 1501436825
+licenseType: Free
+NativeFormatImporter:
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1274 - 55
game/Assets/Prefabs/Enemy.prefab


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 439 - 1427
game/Assets/Scenes/Main.unity


+ 31 - 0
game/Assets/Scripts/Enemy/Enemy.cs

@@ -4,6 +4,8 @@ using UnityEngine;
 
 public class Enemy : MonoBehaviour 
 {
+    public float powerSuckDelay = 1;
+
     [SerializeField]
     private GameObject powerDrop;
     [SerializeField]
@@ -16,6 +18,8 @@ public class Enemy : MonoBehaviour
 
     private DayTimeLabel lastCharging;
 
+    private IEnumerator drainCoroutine;
+
     void OnCollisionEnter(Collision collision)
     {
         if(!dead)
@@ -24,6 +28,20 @@ public class Enemy : MonoBehaviour
             {
                 Death();
             }
+            else if (collision.collider.tag == "Player")
+            {
+                drainCoroutine = DrainPower(collision.collider.GetComponent<Player>());
+                StartCoroutine(drainCoroutine);
+            }
+        }
+    }
+
+    void OnCollisionExit(Collision collision)
+    {
+        if (collision.collider.tag == "Player")
+        {
+            if (drainCoroutine != null)
+                StopCoroutine(drainCoroutine);
         }
     }
 
@@ -98,4 +116,17 @@ public class Enemy : MonoBehaviour
 
         GameObject.Destroy(gameObject);
     }
+
+    private IEnumerator DrainPower(Player player)
+    {
+        while (true)
+        {
+            yield return new WaitForSeconds(powerSuckDelay);
+
+
+                player.PowerLevel -= 0.5f;
+
+            
+        }
+    }
 }