Added EntitySpawner
This commit is contained in:
parent
68d51ac6c2
commit
a007d306e7
4928 changed files with 436802 additions and 436763 deletions
8
InsAsterix/Assets/Scenes/Spawners.meta
Normal file
8
InsAsterix/Assets/Scenes/Spawners.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5a7bca89c70480afc9f6a1ef3f26c356
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
46
InsAsterix/Assets/Scenes/Spawners/EntitySpawner.prefab
Normal file
46
InsAsterix/Assets/Scenes/Spawners/EntitySpawner.prefab
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1261290536216742845
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6214812198674791343}
|
||||
- component: {fileID: 934744677166207459}
|
||||
m_Layer: 0
|
||||
m_Name: EntitySpawner
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6214812198674791343
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1261290536216742845}
|
||||
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: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &934744677166207459
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1261290536216742845}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dff4f86e5115231a19bfba8c727305dc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e8524a4699d5e0d378b5b994c0a36044
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
InsAsterix/Assets/Scripts.meta
Normal file
8
InsAsterix/Assets/Scripts.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 55e9db603bde325f0a7d565f32f42f06
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
11
InsAsterix/Assets/Scripts/Despawn.cs
Normal file
11
InsAsterix/Assets/Scripts/Despawn.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public interface Despawn
|
||||
{
|
||||
|
||||
public delegate void EntityDespawnDelegate(Despawn despawn);
|
||||
public event EntityDespawnDelegate entityDespawnEvent;
|
||||
|
||||
}
|
||||
11
InsAsterix/Assets/Scripts/Despawn.cs.meta
Normal file
11
InsAsterix/Assets/Scripts/Despawn.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4d5bc716b058119358d644b42c21fb02
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
19
InsAsterix/Assets/Scripts/EntitySpawner.cs
Normal file
19
InsAsterix/Assets/Scripts/EntitySpawner.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EntitySpawner : MonoBehaviour
|
||||
{
|
||||
public GameObject EntityToSpawn ;
|
||||
public Vector2[] SpawnPositions;
|
||||
|
||||
void SpawnEntity() {
|
||||
Vector2 newPositionID = SpawnPositions[Random.Range(0,SpawnPositions.Length)] ;
|
||||
GameObject instance = Instantiate(EntityToSpawn, newPositionID, Quaternion.identity) ;
|
||||
instance.GetComponent<Despawn>().entityDespawnEvent += onEntityDespawn;
|
||||
}
|
||||
|
||||
void onEntityDespawn(Despawn despawn){
|
||||
SpawnEntity() ;
|
||||
}
|
||||
}
|
||||
11
InsAsterix/Assets/Scripts/EntitySpawner.cs.meta
Normal file
11
InsAsterix/Assets/Scripts/EntitySpawner.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dff4f86e5115231a19bfba8c727305dc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
InsAsterix/Library/Artifacts/03/0330b5d5920dc831dc4cc0f2600b7182
Normal file
BIN
InsAsterix/Library/Artifacts/03/0330b5d5920dc831dc4cc0f2600b7182
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
InsAsterix/Library/Artifacts/07/07077fa78a2c4ccd1f420090a0dc81ca
Normal file
BIN
InsAsterix/Library/Artifacts/07/07077fa78a2c4ccd1f420090a0dc81ca
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
InsAsterix/Library/Artifacts/09/097d51fe409371a0ba793de738f2e504
Normal file
BIN
InsAsterix/Library/Artifacts/09/097d51fe409371a0ba793de738f2e504
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
InsAsterix/Library/Artifacts/0e/0e7015d6a1ecb236dd3d6b66dc30aabd
Normal file
BIN
InsAsterix/Library/Artifacts/0e/0e7015d6a1ecb236dd3d6b66dc30aabd
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
InsAsterix/Library/Artifacts/13/135bed32508cff3fabc004308a22c12f
Normal file
BIN
InsAsterix/Library/Artifacts/13/135bed32508cff3fabc004308a22c12f
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue