Commit bd75be49 authored by Simen Ulvestad's avatar Simen Ulvestad
Browse files

add spawner block

parent e60be53f
......@@ -2,63 +2,63 @@
# www.blender.org
mtllib BoundingBox.mtl
o Cube
v 0.936480 0.936480 0.396835
v 1.063520 0.936480 0.396835
v 1.063520 1.063520 0.396835
v 0.936480 1.063520 0.396835
v 0.936480 0.885594 1.063520
v 0.885594 1.063520 1.063520
v 0.885594 1.063520 0.936480
v 0.936480 0.936480 0.885594
v 1.063520 0.936480 0.885594
v 1.063520 1.063520 0.885594
v 0.936480 1.063520 0.885594
v 0.885594 0.936480 0.936480
v 0.885594 0.936480 1.063520
v 0.396835 1.063520 1.063520
v 0.396835 1.063520 0.936480
v 0.396835 0.936480 0.936480
v 0.396835 0.936480 1.063520
v 0.936480 0.885594 0.936480
v 1.063520 0.885594 0.936480
v 1.063520 0.885594 1.063520
v 0.936480 0.396835 1.063520
v 0.936480 0.396835 0.936480
v 1.063520 0.396835 0.936480
v 1.063520 0.396835 1.063520
v 0.969750 0.885594 0.969750
v 1.030250 0.885594 0.969750
v 1.030250 0.885594 1.030250
v 0.969750 0.885594 1.030250
v 0.969750 0.396835 0.969750
v 0.885594 1.030250 1.030250
v 0.885594 1.030250 0.969750
v 1.030250 0.396835 0.969750
v 1.030250 0.396835 1.030250
v 0.969750 0.396835 1.030250
v 0.969750 0.969750 0.396835
v 0.885594 0.969750 0.969750
v 0.885594 0.969750 1.030250
v 0.396835 1.030250 1.030250
v 0.396835 1.030250 0.969750
v 0.396835 0.969750 0.969750
v 0.396835 0.969750 1.030250
v 1.030250 0.969750 0.396835
v 1.030250 1.030250 0.396835
v 0.969750 1.030250 0.396835
v 0.969750 0.969750 0.885594
v 1.030250 0.969750 0.885594
v 1.030250 1.030250 0.885594
v 0.969750 1.030250 0.885594
vn 0.0000 -1.0000 0.0000
vn -1.0000 0.0000 0.0000
vn -0.7071 0.0000 -0.7071
vn 0.0000 0.0000 1.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 1.0000 0.0000
vn -0.5774 -0.5774 -0.5773
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 -0.7071 -0.7071
vn -0.7071 -0.7071 0.0000
vn -0.7071 0.0000 -0.7071
vn -0.5774 -0.5773 -0.5774
vn 0.5774 0.5774 0.5774
vn 0.5773 0.5774 0.5774
usemtl None
s off
f 17//1 16//1 12//1 13//1
f 4//2 1//2 8//2 11//2
f 3//3 4//3 11//3 10//3
f 2//4 3//4 10//4 9//4
f 14//2 15//2 16//2 17//2
f 1//1 2//1 9//1 8//1
f 4//5 3//5 2//5 1//5
f 21//1 22//1 23//1 24//1
f 21//6 24//6 20//6 5//6
f 14//6 17//6 13//6 6//6
f 7//3 24//3 21//3 12//3
f 14//4 17//4 13//4 6//4
f 16//5 15//5 7//5 12//5
f 15//3 14//3 6//3 7//3
f 24//4 23//4 19//4 20//4
f 23//5 22//5 18//5 19//5
f 22//2 21//2 5//2 18//2
f 8//7 9//7 19//7 18//7
f 13//8 12//8 18//8 5//8
f 11//9 8//9 12//9 7//9
f 18//10 12//10 8//10
f 10//3 11//3 7//3 6//3
f 9//4 10//4 20//4 19//4
f 6//6 13//6 5//6 20//6
f 6//11 20//11 10//11
f 15//6 14//6 6//6 7//6
f 1//7 12//7 21//7
f 10//4 9//4 3//4 4//4
f 5//1 8//1 9//1 10//1
f 5//2 10//2 4//2 1//2
f 9//8 8//8 2//8 3//8
f 8//5 5//5 1//5 2//5
f 19//6 20//6 24//6 23//6
f 18//8 19//8 23//8 22//8
f 20//2 11//2 21//2 24//2
f 20//5 19//5 18//5 11//5
f 11//1 18//1 22//1 21//1
f 21//9 22//9 2//9 1//9
f 12//10 1//10 4//10 13//10
f 24//6 7//6 6//6 23//6
f 3//8 2//8 22//8 23//8
f 6//4 13//4 4//4 3//4
f 23//11 6//11 3//11
......@@ -20,10 +20,14 @@ public class ObjectSpawner : MonoBehaviour
//Mesh mesh2 = Instantiate(mesh);
//_previewObject.GetComponent<MeshFilter>().sharedMesh = mesh;
SpawnObject();
}
void SpawnObject()
{
_spawnedObject = Instantiate(_spawnObject);
_spawnedObject.transform.position = transform.position;
_spawnedObject.transform.localScale = new Vector3(_scale, _scale, _scale);
}
// Update is called once per frame
......@@ -31,4 +35,14 @@ public class ObjectSpawner : MonoBehaviour
{
}
private void OnTriggerExit(Collider other)
{
// Debug.Log("collison exit: " + other);
//Debug.Log(other.gameObject.name + " == " + _spawnedObject.name + "(Clone): " + (other.gameObject.name == _spawnedObject.name).ToString());
if (other.gameObject.name == _spawnedObject.name)
{
SpawnObject();
}
}
}
......@@ -78,3 +78,15 @@ MonoBehaviour:
enabled: 0
- name: VoiceInput
enabled: 0
- name: AddressBookBasicAccess
enabled: 0
- name: BluetoothAdapterExternalApp
enabled: 0
- name: BluetoothAdapterUser
enabled: 0
- name: BluetoothGattWrite
enabled: 0
- name: SocialConnectionsInvitesAccess
enabled: 0
- name: FineLocation
enabled: 0
......@@ -10,6 +10,8 @@ GameObject:
m_Component:
- component: {fileID: 6572955735984239228}
- component: {fileID: 6572955735984239229}
- component: {fileID: 4512608947078302633}
- component: {fileID: 689590874459248569}
m_Layer: 0
m_Name: ObjectSpawner
m_TagString: Untagged
......@@ -25,7 +27,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6572955735984239170}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1.359, y: 0, z: 0.095}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2183507653728355738}
......@@ -53,6 +55,35 @@ MonoBehaviour:
m_EditorClassIdentifier:
_spawnObject: {fileID: 0}
_scale: 0.5
--- !u!65 &4512608947078302633
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6572955735984239170}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.8, y: 0.8, z: 0.8}
m_Center: {x: 0, y: 0, z: 0}
--- !u!54 &689590874459248569
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6572955735984239170}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!1001 &1262510503504755317
PrefabInstance:
m_ObjectHideFlags: 0
......
This diff is collapsed.
......@@ -46,12 +46,16 @@ public class Selector : MonoBehaviourPunCallbacks
List<Collider> cols = GetColliders();
if (cols.Count > 0)
{
GameObject obj = cols[cols.Count - 1].gameObject;
if(obj.GetComponent<SelectableObject>() != null)
for (int i = cols.Count - 1; i >= 0; i--)
{
obj.GetComponent<SelectableObject>().OnSelect();
_gameMenu.SetSelection(obj);
return obj;
GameObject obj = cols[i].gameObject;
if (obj.GetComponent<SelectableObject>() != null)
//if(typeof(SelectableObject) = obj)
{
obj.GetComponent<SelectableObject>().OnSelect();
_gameMenu.SetSelection(obj);
return obj;
}
}
Debug.Log("Not selectable");
}
......
Build from DESKTOP-S8N6TLA at 20.01.2020 13.53.53
\ No newline at end of file
Build from DESKTOP-S8N6TLA at 20.01.2020 16.19.45
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment