Move control of active tetromino to a separate object.
This commit is contained in:
parent
feda7a1a8a
commit
73f470a968
12 changed files with 5372 additions and 232 deletions
5014
Assets/Scenes/backgroundTest.unity
Normal file
5014
Assets/Scenes/backgroundTest.unity
Normal file
File diff suppressed because it is too large
Load diff
7
Assets/Scenes/backgroundTest.unity.meta
Normal file
7
Assets/Scenes/backgroundTest.unity.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7759d30d35aebb7409c7c7983da150cf
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -244,7 +244,7 @@ Transform:
|
|||
m_Children:
|
||||
- {fileID: 698299619}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &389734758
|
||||
MonoBehaviour:
|
||||
|
@ -389,7 +389,7 @@ Transform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &632894587
|
||||
GameObject:
|
||||
|
@ -484,7 +484,7 @@ RectTransform:
|
|||
m_Children:
|
||||
- {fileID: 293561671}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 5
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
|
@ -682,7 +682,7 @@ Transform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 6
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &978697293
|
||||
GameObject:
|
||||
|
@ -741,50 +741,6 @@ BoxCollider2D:
|
|||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1 &1088114506
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1088114507}
|
||||
- component: {fileID: 1088114508}
|
||||
m_Layer: 0
|
||||
m_Name: PlatformManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1088114507
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1088114506}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -1.1146629, y: -6.0253134, z: -16.225655}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1088114508
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1088114506}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c72fe2c4f20f84d499e7ad3778380e5a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
coin: {fileID: 0}
|
||||
--- !u!850595691 &1102513894
|
||||
LightingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -938,6 +894,50 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 5a80f1ba48891d044be87cf27be7283c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1451940422
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1451940423}
|
||||
- component: {fileID: 1451940424}
|
||||
m_Layer: 0
|
||||
m_Name: tetrominoUserControl
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1451940423
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1451940422}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 4.200976, y: -5.5212994, z: -1.4792265}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 7
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1451940424
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1451940422}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb63a584bd2551af7ac0330838788b6b, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
activeTetromino: {fileID: 0}
|
||||
--- !u!1 &1595125480
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -950,7 +950,7 @@ GameObject:
|
|||
- component: {fileID: 1595125482}
|
||||
- component: {fileID: 1595125481}
|
||||
m_Layer: 0
|
||||
m_Name: ground (1)
|
||||
m_Name: ground
|
||||
m_TagString: Ground
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
@ -1046,7 +1046,7 @@ Transform:
|
|||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 7
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1618236901
|
||||
GameObject:
|
||||
|
@ -1079,7 +1079,7 @@ Transform:
|
|||
- {fileID: 1643835946}
|
||||
- {fileID: 978697294}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 4
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1643835945
|
||||
GameObject:
|
||||
|
@ -1138,7 +1138,7 @@ BoxCollider2D:
|
|||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 3.1122367}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1 &1721098482
|
||||
--- !u!1 &1955489873
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
|
@ -1146,189 +1146,45 @@ GameObject:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1721098484}
|
||||
- component: {fileID: 1721098483}
|
||||
- component: {fileID: 1721098486}
|
||||
- component: {fileID: 1955489875}
|
||||
- component: {fileID: 1955489874}
|
||||
m_Layer: 0
|
||||
m_Name: Floor
|
||||
m_TagString: Ground
|
||||
m_Name: tetrominoSpawnManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!212 &1721098483
|
||||
SpriteRenderer:
|
||||
--- !u!114 &1955489874
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1721098482}
|
||||
m_GameObject: {fileID: 1955489873}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: -1
|
||||
m_Sprite: {fileID: 21300000, guid: c511d5e2a73e6ae43b0c7f352fd5e937, type: 3}
|
||||
m_Color: {r: 0.5660378, g: 0.5660378, b: 0.5660378, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!4 &1721098484
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b7c259a727c394546a0ecfc370bd9abd, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
spawnPoint: {x: 0, y: 0, z: 0}
|
||||
tetrominoSquare: {fileID: 0}
|
||||
tetrominoLine: {fileID: 0}
|
||||
tetrominoL: {fileID: 0}
|
||||
tetrominoR: {fileID: 0}
|
||||
tetrominoS: {fileID: 0}
|
||||
tetrominoT: {fileID: 0}
|
||||
--- !u!4 &1955489875
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1721098482}
|
||||
m_GameObject: {fileID: 1955489873}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -0.04, y: -13.09, z: 0}
|
||||
m_LocalScale: {x: 19.963354, y: 1, z: 1}
|
||||
m_LocalPosition: {x: 0, y: 12, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_RootOrder: 6
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!61 &1721098486
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1721098482}
|
||||
m_Enabled: 1
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_UsedByComposite: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 0.25, y: 0.25}
|
||||
newSize: {x: 1, y: 1}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1001 &1931844156
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2476539558998008745, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_Size.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2476539558998008745, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_Offset.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2515058371580459852, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: timeBetweenSteps
|
||||
value: 0.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3240507130499138989, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 8
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3240507130499138989, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 8.974025
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3240507130499138989, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -5.5230865
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3240507130499138989, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -18.260555
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3240507130499138989, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3240507130499138989, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3240507130499138989, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3240507130499138989, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3240507130499138989, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3240507130499138989, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3240507130499138989, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8879328482314783852, guid: 30aadf876ae2982109a7e009934ebcb3,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: tetris
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 30aadf876ae2982109a7e009934ebcb3, type: 3}
|
||||
|
|
|
@ -8,6 +8,7 @@ public class tetromino : MonoBehaviour
|
|||
{
|
||||
public float timeBetweenSteps;
|
||||
public bool active = true;
|
||||
public tetrominoUserControl TetrominoUserControl;
|
||||
|
||||
private float stepTimer = 0.0f;
|
||||
private bool wouldCollide = false;
|
||||
|
@ -15,7 +16,8 @@ public class tetromino : MonoBehaviour
|
|||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
TetrominoUserControl = FindObjectOfType<tetrominoUserControl>();
|
||||
TetrominoUserControl.setActiveTetromino(gameObject);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
|
@ -28,16 +30,7 @@ public class tetromino : MonoBehaviour
|
|||
stepTimer = stepTimer - timeBetweenSteps;
|
||||
nextStep();
|
||||
}
|
||||
|
||||
if (Input.GetButtonDown("tetrisMoveLeft") && active)
|
||||
{
|
||||
transform.position += Vector3.left * 1.0f;
|
||||
}
|
||||
|
||||
if (Input.GetButtonDown("tetrisMoveRight") && active)
|
||||
{
|
||||
transform.position += Vector3.right * 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void nextStep()
|
||||
|
@ -48,7 +41,6 @@ public class tetromino : MonoBehaviour
|
|||
//Only do this if it's a piece at the bottom, so we don't detect ourself as a collision.
|
||||
if (Math.Abs(child.localPosition.y - (0.5)) < 0.001) //my IDE suggested I do this to fix floating-point comparison issues, and I see the logic at work here.
|
||||
{
|
||||
Debug.Log("Checking position: " + child.position);
|
||||
if (validateFall(child))
|
||||
{
|
||||
wouldCollide = true;
|
||||
|
@ -72,7 +64,7 @@ public class tetromino : MonoBehaviour
|
|||
//Cast a ray to the next position of the tetromino.
|
||||
//NOTE: disabled "Queries Start in Colliders" in Project Settings>Physics 2D (thank you again, Tavi).
|
||||
RaycastHit2D collision = Physics2D.Raycast(pieceToCheck.position, Vector2.down, 1.0f);
|
||||
Debug.DrawRay(pieceToCheck.position,Vector3.down,Color.red,1000.0f);
|
||||
// Debug.DrawRay(pieceToCheck.position,Vector3.down,Color.red,1000.0f);
|
||||
if (collision.collider != null && collision.collider.name != pieceToCheck.name)
|
||||
{
|
||||
Debug.Log("Collided with object: " + collision.collider.name);
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Collections.Generic;
|
|||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
public class tetrisManager : MonoBehaviour
|
||||
public class tetrominoSpawnManager : MonoBehaviour
|
||||
{
|
||||
public Vector3 spawnPoint;
|
||||
public GameObject tetrominoSquare;
|
33
Assets/Scripts/tetrominoUserControl.cs
Normal file
33
Assets/Scripts/tetrominoUserControl.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class tetrominoUserControl : MonoBehaviour
|
||||
{
|
||||
public GameObject activeTetromino;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (Input.GetButtonDown("tetrisMoveLeft") && activeTetromino != null)
|
||||
{
|
||||
activeTetromino.gameObject.transform.position += Vector3.left * 1.0f;
|
||||
}
|
||||
|
||||
if (Input.GetButtonDown("tetrisMoveRight") && activeTetromino != null)
|
||||
{
|
||||
activeTetromino.gameObject.transform.position += Vector3.right * 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
public void setActiveTetromino(GameObject tetromino)
|
||||
{
|
||||
activeTetromino = tetromino;
|
||||
}
|
||||
}
|
11
Assets/Scripts/tetrominoUserControl.cs.meta
Normal file
11
Assets/Scripts/tetrominoUserControl.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bb63a584bd2551af7ac0330838788b6b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/Sprites/gridLine.png
Normal file
BIN
Assets/Sprites/gridLine.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 110 B |
132
Assets/Sprites/gridLine.png.meta
Normal file
132
Assets/Sprites/gridLine.png.meta
Normal file
|
@ -0,0 +1,132 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 57b253228cf2f0c78bf7a457e4750009
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 0
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
87
Assets/Sprites/gridLineMaterial.mat
Normal file
87
Assets/Sprites/gridLineMaterial.mat
Normal file
|
@ -0,0 +1,87 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: gridLineMaterial
|
||||
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords: PIXELSNAP_ON
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _AlphaTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _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_Ints: []
|
||||
m_Floats:
|
||||
- PixelSnap: 1
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _EnableExternalAlpha: 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}
|
||||
- _Flip: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_BuildTextureStacks: []
|
8
Assets/Sprites/gridLineMaterial.mat.meta
Normal file
8
Assets/Sprites/gridLineMaterial.mat.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e87f6cc13f19080288a2a85b96ee5411
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in a new issue