Commit a3075ab4 authored by 18손재민's avatar 18손재민

타이머 wip

parent bda25718
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_SourcePrefab: {fileID: 0}
m_RootGameObject: {fileID: 1905620500639870}
m_IsPrefabAsset: 1
--- !u!1 &1011679866889224
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224500907550295940}
- component: {fileID: 222306734366933398}
- component: {fileID: 114817969944965916}
m_Layer: 5
m_Name: ClockFrame
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1366593566279772
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224959528616095188}
- component: {fileID: 222495024401785970}
- component: {fileID: 114407523094923432}
m_Layer: 5
m_Name: ClockHand
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1905620500639870
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224766102616962246}
- component: {fileID: 114934333361816604}
m_Layer: 0
m_Name: Clock
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &114407523094923432
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1366593566279772}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 2c9cb87102d86ec44a8661784a5a42c3, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114817969944965916
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1011679866889224}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 0b30cf9c50adf214a9f028fe6abe89af, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114934333361816604
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1905620500639870}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76972544344a33b4a970e7e902757457, type: 3}
m_Name:
m_EditorClassIdentifier:
timeToFallTetrimino: 10
tetriminoWaitedTime: 0
tetriminoCreatedTime: 0
--- !u!222 &222306734366933398
CanvasRenderer:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1011679866889224}
m_CullTransparentMesh: 0
--- !u!222 &222495024401785970
CanvasRenderer:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1366593566279772}
m_CullTransparentMesh: 0
--- !u!224 &224500907550295940
RectTransform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1011679866889224}
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_Children: []
m_Father: {fileID: 224766102616962246}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224766102616962246
RectTransform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1905620500639870}
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_Children:
- {fileID: 224500907550295940}
- {fileID: 224959528616095188}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 100, y: -90}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224959528616095188
RectTransform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1366593566279772}
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_Children: []
m_Father: {fileID: 224766102616962246}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
fileFormatVersion: 2
guid: 6716cb822904bb248a894f7aec342a54
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
......@@ -77,7 +77,7 @@ public class CameraController : MonoBehaviour {
GameManager.Instance.minimap.SetActive(true);
GameManager.gameState = GameState.Ingame;
StartCoroutine(MapManager.Instance.RoomFadeIn(MapManager.currentRoom));
grid.transform.position = new Vector3(0, 0, 0);
grid.transform.position = Vector3.zero;
sizeDestination = inGameCameraSize;
while (GetComponent<Camera>().orthographicSize > sizeDestination + 0.01)
{
......
......@@ -9,6 +9,10 @@ public class MapManager : Singleton<MapManager> {
* */
public GameObject player;
/// <summary>
/// The clock indicates time of tetrimino.
/// </summary>
public Timer clock;
/// <summary>
/// Grid showing tiles.
/// </summary>
public Transform grid;
......@@ -19,7 +23,7 @@ public class MapManager : Singleton<MapManager> {
/// <summary>
/// Tetris map's coordinates.
/// </summary>
public static Vector3 tetrisMapCoord = new Vector3(0, 0, 0);
public static Vector3 tetrisMapCoord = Vector3.zero;
/// <summary>
/// Tetrimino falling speed.
/// </summary>
......@@ -33,18 +37,6 @@ public class MapManager : Singleton<MapManager> {
/// </summary>
public float gravity = 0.98f;
/// <summary>
/// Time tetrimino would wait until it falls.
/// </summary>
public float timeToFallTetrimino;
/// <summary>
/// Time tetris waits to fall.
/// </summary>
public float tetriminoWaitedTime;
/// <summary>
/// Time tetris has created.
/// </summary>
public float tetriminoCreatedTime;
/// <summary>
/// Time Tetrimino has fallen.
/// </summary>
private float fallTime;
......@@ -185,14 +177,14 @@ public class MapManager : Singleton<MapManager> {
public static Vector2 portalDestination;
public RoomInGame[] normalRoomList1;
public RoomInGame[] normalRoomList2;
/*public RoomInGame[] normalRoomList3;
/*public RoomInGame[] normalRoomList2;
public RoomInGame[] normalRoomList3;
public RoomInGame[] normalRoomList4;
public RoomInGame[] normalRoomList5;*/
public RoomInGame[] specialRoomList1;
public RoomInGame[] specialRoomList2;
/*public RoomInGame[] specialRoomList3;
/*public RoomInGame[] specialRoomList2;
public RoomInGame[] specialRoomList3;
public RoomInGame[] specialRoomList4;
public RoomInGame[] specialRoomList5;*/
......@@ -210,16 +202,16 @@ public class MapManager : Singleton<MapManager> {
public List<Sprite>[] roomSurfaceSpritesDistributed = new List<Sprite>[5];
public Sprite[] roomSurfaceSprite1;
public Sprite[] roomSurfaceSprite2;
/*public Sprite[] roomSurfaceSprite3;
/*public Sprite[] roomSurfaceSprite2;
public Sprite[] roomSurfaceSprite3;
public Sprite[] roomSurfaceSprite4;
public Sprite[] roomSurfaceSprite5;*/
public List<Sprite>[] roomBackgroundSpritesDistributed = new List<Sprite>[5];
public Sprite[] roomBackgroundSprite1;
public Sprite[] roomBackgroundSprite2;
/*public Sprite[] roomBackgroundSprite3;
/*public Sprite[] roomBackgroundSprite2;
public Sprite[] roomBackgroundSprite3;
public Sprite[] roomBackgroundSprite4;
public Sprite[] roomBackgroundSprite5;*/
......@@ -543,23 +535,6 @@ public class MapManager : Singleton<MapManager> {
}
}
/// <summary>
/// Display how much time is it remain to fall current tetrimino.
/// </summary>
/// <returns></returns>
public IEnumerator CountTetriminoWaitingTime()
{
while (!isTetriminoFalling)
{
while (GameManager.gameState == GameState.Portal)
{
tetriminoCreatedTime += Time.deltaTime;
yield return null;
}
yield return new WaitForSeconds(0.1f);
tetriminoWaitedTime = Time.time - tetriminoCreatedTime;
}
}
/// <summary>
/// Move tetrimino horizontally.
/// </summary>
/// <param name="te"></param>
......@@ -663,11 +638,13 @@ public class MapManager : Singleton<MapManager> {
{
te.transform.position = new Vector3(te.mapCoord.x * tetrisMapSize, tetrisYCoord[(int)te.mapCoord.y], te.mapCoord.z * tetrisMapSize);
fallSpeed = initialFallSpeed;
tetriminoWaitedTime = 0;
StopCoroutine(Timer.timer);
UpdateMap(te);
CreateRoom(te);
DeleteFullRows();
Destroy(currentGhost.gameObject);
if(clock.clockSpeedStack < 12)
clock.clockSpeedStack += 1;
StartCoroutine(MakeNextTetrimino());
}
/// <summary>
......@@ -715,7 +692,7 @@ public class MapManager : Singleton<MapManager> {
/// <param name="te">Tetrimino you want to move.</param>
public void TetriminoControl(Tetrimino te)
{
if (tetriminoWaitedTime > timeToFallTetrimino)
if (clock.tetriminoWaitedTime > clock.timeToFallTetrimino)
{
isTetriminoFalling = true;
TetriminoMapCoordDown(currentTetrimino);
......@@ -852,6 +829,7 @@ public class MapManager : Singleton<MapManager> {
/// <returns></returns>
public IEnumerator MakeNextTetrimino()
{
StartCoroutine(GameObject.Find("Clock").GetComponent<Timer>().ResetClock());
yield return new WaitForSeconds(1f);
TetriminoSpawner.Instance.MakeTetrimino();
}
......@@ -865,7 +843,7 @@ public class MapManager : Singleton<MapManager> {
room.GetComponent<SpriteRenderer>().sprite = roomSurfaceSpritesDistributed[room.stage][(int)room.specialRoomType - 1];
currentRoom = newRoom;
playerIcon.transform.parent = currentRoom.transform;
MapManager.Instance.playerIcon.transform.localPosition = new Vector3(0, 0, 0);
MapManager.Instance.playerIcon.transform.localPosition = Vector3.zero;
StartCoroutine(RoomFadeIn(newRoom));
}
/// <summary>
......@@ -1040,10 +1018,10 @@ public class MapManager : Singleton<MapManager> {
for (int i = 0; i < normalRoomList1.Length; i++)
if (normalRoomList1[i].leftDoorInfo[leftDoor] == true && normalRoomList1[i].rightDoorInfo[rightDoor] == true && normalRoomList1[i].concept[concept] == true)
normalRoomsDistributed[0, concept, 2 - leftDoor, 2 - rightDoor].Add(normalRoomList1[i]);
for (int i = 0; i < normalRoomList2.Length; i++)
/*for (int i = 0; i < normalRoomList2.Length; i++)
if (normalRoomList2[i].leftDoorInfo[leftDoor] == true && normalRoomList2[i].rightDoorInfo[rightDoor] == true && normalRoomList2[i].concept[concept] == true)
normalRoomsDistributed[1, concept, 2 - leftDoor, 2 - rightDoor].Add(normalRoomList2[i]);
/*for (int i = 0; i < normalRoomList3.Length; i++)
for (int i = 0; i < normalRoomList3.Length; i++)
if (normalRoomList3[i].leftDoorInfo[leftDoor] == true && normalRoomList3[i].rightDoorInfo[rightDoor] == true && normalRoomList3[i].concept[concept] == true)
normalRoomsDistributed[2, concept, 2 - leftDoor, 2 - rightDoor].Add(normalRoomList1[i]);
for (int i = 0; i < normalRoomList4.Length; i++)
......@@ -1073,7 +1051,7 @@ public class MapManager : Singleton<MapManager> {
else if (specialRoomList1[i].name.Contains("Boss"))
specialRoomsDistributed[0, concept, (int)RoomType.Boss, 2 - leftDoor, 2 - rightDoor].Add(specialRoomList1[i]);
}
for (int i = 0; i < specialRoomList2.Length; i++)
/*for (int i = 0; i < specialRoomList2.Length; i++)
if (specialRoomList2[i].leftDoorInfo[leftDoor] == true && specialRoomList2[i].rightDoorInfo[rightDoor] == true && specialRoomList2[i].concept[concept] == true)
{
if (specialRoomList2[i].name.Contains("Start"))
......@@ -1089,7 +1067,7 @@ public class MapManager : Singleton<MapManager> {
else if (specialRoomList2[i].name.Contains("Boss"))
specialRoomsDistributed[0, concept, (int)RoomType.Boss, 2 - leftDoor, 2 - rightDoor].Add(specialRoomList2[i]);
}
/*for (int i = 0; i < SpecialRoomList3.Length; i++)
for (int i = 0; i < SpecialRoomList3.Length; i++)
if (SpecialRoomList3[i].leftDoorInfo[leftDoor] == true && SpecialRoomList3[i].rightDoorInfo[rightDoor] == true && SpecialRoomList3[i].concept[concept] == true)
{
if (SpecialRoomList3[i].name.Contains("Start"))
......@@ -1141,16 +1119,16 @@ public class MapManager : Singleton<MapManager> {
for (RoomSpriteType spriteType = 0; (int)spriteType < 9; spriteType++)
{
roomSurfaceSpritesDistributed[0].Add(roomSurfaceSprite1[(int)spriteType]);
roomSurfaceSpritesDistributed[1].Add(roomSurfaceSprite2[(int)spriteType]);
/*roomSurfaceSpritesDistributed[2].Add(roomSurfaceSprite3[(int)spriteType]);
/*roomSurfaceSpritesDistributed[1].Add(roomSurfaceSprite2[(int)spriteType]);
roomSurfaceSpritesDistributed[2].Add(roomSurfaceSprite3[(int)spriteType]);
roomSurfaceSpritesDistributed[3].Add(roomSurfaceSprite4[(int)spriteType]);
roomSurfaceSpritesDistributed[4].Add(roomSurfaceSprite5[(int)spriteType]);*/
}
for(int i = 0; i < roomBackgroundSprite1.Length; i++)
roomBackgroundSpritesDistributed[0].Add(roomBackgroundSprite1[i]);
for (int i = 0; i < roomBackgroundSprite2.Length; i++)
/*for (int i = 0; i < roomBackgroundSprite2.Length; i++)
roomBackgroundSpritesDistributed[1].Add(roomBackgroundSprite2[i]);
/*for (int i = 0; i < roomBackgroundSprite3.Length; i++)
for (int i = 0; i < roomBackgroundSprite3.Length; i++)
roomBackgroundSpritesDistributed[2].Add(roomBackgroundSprite3[i]);
for (int i = 0; i < roomBackgroundSprite4.Length; i++)
roomBackgroundSpritesDistributed[3].Add(roomBackgroundSprite4[i]);
......@@ -1158,6 +1136,7 @@ public class MapManager : Singleton<MapManager> {
roomBackgroundSpritesDistributed[4].Add(roomBackgroundSprite5[i]);*/
currentStage = 0;
player = GameObject.Find("Player");
clock = GameObject.Find("Clock").GetComponent<Timer>();
grid = GameObject.Find("Grid").transform;
}
......@@ -1182,14 +1161,9 @@ public class MapManager : Singleton<MapManager> {
}
}
if(GameManager.gameState == GameState.Portal)
{
PortalControl();
}
//playerIcon.transform.position = currentRoom.mapCoord * tetrisMapSize + new Vector3(0, 0, grid.transform.position.z - 2);
if (!currentRoom.isRoomCleared && (EnemyManager.Instance.IsClear() || (currentRoom.specialRoomType != RoomType.Normal && currentRoom.specialRoomType != RoomType.Boss)))
{
currentRoom.ClearRoom();
}
}
}
}
......@@ -397,6 +397,9 @@ public class Room : MonoBehaviour
portalSurface = Instantiate(MapManager.Instance.portalSurface, transform.position + new Vector3(12, 12, 0), Quaternion.identity, transform);
}
isRoomCleared = true;
MapManager.Instance.clock.clockSpeedStack -= 3;
if (MapManager.Instance.clock.clockSpeedStack < 0)
MapManager.Instance.clock.clockSpeedStack = 0;
if (specialRoomType == RoomType.Boss)
MapManager.currentStage += 1;
}
......
......@@ -45,7 +45,7 @@ public class Test : MonoBehaviour {
}
public void Timer()
{
timer.text = (MapManager.Instance.timeToFallTetrimino - MapManager.Instance.tetriminoWaitedTime).ToString();
timer.text = (MapManager.Instance.clock.timeToFallTetrimino - MapManager.Instance.clock.tetriminoWaitedTime).ToString();
}
public void ClearRoom()
{
......
......@@ -10,7 +10,7 @@ public class TetriminoSpawner : Singleton<TetriminoSpawner> {
/// <summary>
/// All tetriminoes.
/// </summary>
public Tetrimino[] tetriminoes;
public Tetrimino[] tetriminoes;
/// <summary>
/// All ghosts.
/// </summary>
......@@ -70,8 +70,8 @@ public Tetrimino[] tetriminoes;
{
MapManager.Instance.UpgradeRoom(MapManager.Instance.roomsWaiting.Dequeue());
}
MapManager.Instance.tetriminoCreatedTime = Time.time;
StartCoroutine(MapManager.Instance.CountTetriminoWaitingTime());
MapManager.Instance.clock.tetriminoCreatedTime = Time.time;
Timer.timer = StartCoroutine(GameObject.Find("Clock").GetComponent<Timer>().CountTetriminoWaitingTime());
}
}
/// <summary>
......@@ -101,10 +101,9 @@ public Tetrimino[] tetriminoes;
MapManager.Instance.UpdateMap(MapManager.currentTetrimino);
MapManager.Instance.CreateRoom(MapManager.currentTetrimino);
MapManager.currentRoom.fog.GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, 0);
//MapManager.Instance.playerIcon.transform.position = MapManager.currentRoom.mapCoord * MapManager.tetrisMapSize + new Vector3(0, 0, -2);
MapManager.tempRoom = MapManager.currentRoom;
MapManager.Instance.playerIcon = Instantiate(MapManager.Instance.playerIcon, new Vector3(0, 0, 0), Quaternion.identity, MapManager.currentRoom.transform);
MapManager.Instance.playerIcon.transform.localPosition = new Vector3(0, 0, 0);
MapManager.Instance.playerIcon = Instantiate(MapManager.Instance.playerIcon, Vector3.zero, Quaternion.identity, MapManager.currentRoom.transform);
MapManager.Instance.playerIcon.transform.localPosition = Vector3.zero;
MakeTetrimino();
}
}
......@@ -173,10 +172,7 @@ public Tetrimino[] tetriminoes;
}
return count;
}
/*
* Test
* */
private void Awake()
{
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Timer : MonoBehaviour {
/// <summary>
/// Frame of the clock.
/// </summary>
GameObject clockFrame;
/// <summary>
/// Clock hand of the clock.
/// </summary>
GameObject clockHand;
/// <summary>
/// Coroutine for timer.
/// </summary>
public static Coroutine timer;
/// <summary>
/// The initial time of tetrimino waiting time.
/// </summary>
public float initialTimeToFallTetrimino;
/// <summary>
/// Time tetrimino would wait until it falls.
/// </summary>
public float timeToFallTetrimino;
/// <summary>
/// Time tetris waits to fall.
/// </summary>
public float tetriminoWaitedTime;
/// <summary>
/// Time tetris has created.
/// </summary>
public float tetriminoCreatedTime;
/// <summary>
/// Stack of the clock's speed.
/// Each stack would decrease time to fall tetrimino 3 seconds.
/// </summary>
public int clockSpeedStack = 0;
/// <summary>
/// Resets the clock.
/// </summary>
/// <returns></returns>
public IEnumerator ResetClock()
{
float previousZRotation = clockHand.transform.eulerAngles.z;
float startTime = Time.time, endTime = startTime + 0.5f;
while(Time.time < endTime)
{
yield return null;
if(tetriminoWaitedTime < timeToFallTetrimino)
clockHand.transform.eulerAngles = new Vector3(0, 0, previousZRotation - previousZRotation * (Time.time - startTime) / (endTime - startTime));
}
clockHand.transform.eulerAngles = Vector3.zero;
timeToFallTetrimino = initialTimeToFallTetrimino - 3 * clockSpeedStack;
clockFrame.GetComponent<Image>().color = new Color(1, 1 - (float)20 * clockSpeedStack / 256, 1 - (float)20 * clockSpeedStack / 256);
tetriminoWaitedTime = 0;
}
/// <summary>
/// Display how much time is it remain to fall current tetrimino.
/// </summary>
/// <returns></returns>
public IEnumerator CountTetriminoWaitingTime()
{
yield return null;
while (!MapManager.isTetriminoFalling)
{
yield return null;
while (GameManager.gameState == GameState.Portal)
{
tetriminoCreatedTime += Time.deltaTime;
yield return null;
}
tetriminoWaitedTime = Time.time - tetriminoCreatedTime;
clockHand.transform.eulerAngles = new Vector3(0, 0, -360 * tetriminoWaitedTime / timeToFallTetrimino);
}
if(tetriminoWaitedTime >= timeToFallTetrimino)
clockHand.transform.eulerAngles = Vector3.zero;
}
// Use this for initialization
void Start () {
timeToFallTetrimino = initialTimeToFallTetrimino;
clockFrame = transform.Find("ClockFrame").gameObject;
clockHand = transform.Find("ClockHand").gameObject;
}
// Update is called once per frame
void Update () {
}
}
fileFormatVersion: 2
guid: 76972544344a33b4a970e7e902757457
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0b30cf9c50adf214a9f028fe6abe89af
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 6
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 3ff1e65011e47ad4081417417ad8ee55
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2c9cb87102d86ec44a8661784a5a42c3
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 6
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 11f61272509abe64a8b6b837a0cdea2b
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
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