using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;
public class Box : MonoBehaviour
{
const float Gravity = -0.01f;
const float OffsetY = -0.5f;
[SerializeField]
Tilemap tilemap;
Time60 time60;
Vector3 pos;
Vector3 checkPos = new Vector3();
Vector3 speed = new Vector3();
void Start()
{
GameObject time60Obj = GameObject.Find("Time60");
time60 = time60Obj.GetComponent<Time60>();
pos = this.transform.position;
checkPos = Vector3.zero;
speed = Vector3.zero;
}
void Update()
{
if( time60.CheckFlame() != true) return;
pos = this.transform.position;
checkPos = new Vector3(pos.x, pos.y + OffsetY, 0);
speed.y = speed.y + Gravity;
pos = new Vector3( pos.x, pos.y + speed.y, 0);
transform.position = pos;
}
}