private void Awake() { _priceList = new SortedList <int, decimal>(); _priceManager = gameObject.AddComponent <PriceManager>(); startPos = new Vector3(0.049f, 1.048f + dropHeight, 0f); Instance = this; SpawnBox(); }
public void MouseUp() { if (Mathf.Abs(boxClone.transform.position.x - boxPoolPos.transform.position.x) <= distX && Mathf.Abs(boxClone.transform.position.y - boxPoolPos.transform.position.y) <= distY) { BoxPool boxPool = boxPoolPos.GetComponent <BoxPool>(); boxPool.SetToPool(box); // Destroy(gameObject); } _hit = false; boxPoolPos.GetComponent <BoxPool>().ResetImageColor(); Destroy(boxClone); }
void Start() { m_fDebrisSize = 0.2f; _instance = this; Setup(typeof(BreakableBox)); }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody>(); pool = GameObject.Find("PoolHolder").GetComponent <BoxPool>(); //get the box pool Reset(); }