void OnTriggerEnter(Collider other) { GameObject g = other.gameObject; if (g.transform.parent == transform.parent) { ShopItemSpawner.SendToTrashcan(other.gameObject); if (despawnParticles != null) { Instantiate(despawnParticles, g.transform.position, transform.rotation, transform); } } }
void Start() { swipeDirection = Direction.STILL; articles = new List <VRShopArticle>(); // Spawn the prefabs screens = new List <GameObject>(); for (int i = 1; i < screenCount + 1; i++) { GameObject newScreenObj = GameObject.Instantiate(prefabScreenContainer, transform); newScreenObj.name = "ArticleMonitor" + i.ToString("00"); newScreenObj.GetComponent <ArticleMonitorWrapper>().wallPositionId = i - 1; newScreenObj.GetComponent <ArticleMonitorWrapper>().articleLoadIndexId = i - 1; screens.Add(newScreenObj); } forwardLoadTrigger = screens[0]; backwardLoadTrigger = null; cart = transform.Find("Cart").GetComponent <CartItemsHandler>(); spawner = shopItemSpawner.GetComponent <ShopItemSpawner>(); }