void OnDrop(GameObject droppedObj) { //Get the dropped object's BarrierObjectController BarrierObjectController barrierObj = droppedObj.GetComponent <BarrierObjectController>(); //If it actually has one, destroy the droppedObj if (barrierObj != null) { barrierObj.Kill(); RecreateBarrierObject(); CreateActiveBarrier(droppedObj.transform); } }
void OnDrop(GameObject droppedObj) { // 드롭된 게임오브젝트에서 BarrierObjectController를 찾는다 BarrierObjectController barrierObj = droppedObj.GetComponent <BarrierObjectController>(); // 게임 오브젝트가 BarrierObjectController 컴포넌트를 갖고 있다면 // 그 게임 오브젝트를 제거한다 if (barrierObj != null) { Destroy(droppedObj); RecreateBarrierObject(); CreateActiveBarrier(droppedObj.transform); } }
void OnEnable() { slider = transform.parent.GetComponent <UISlider>(); barrierCtrlr = slider.transform.parent.GetComponent <BarrierObjectController>(); }