// "Overloads" mouse down event for Blocks when they are inside the chunk private void OnMouseDown() { Debug.Log("Click " + this); if (DragAndDropController.IsAvailable()) { this.OnGrab(); } }
protected override void OnGrab() { if (IsActive() && DragAndDropController.IsAvailable()) { var block = Block.FromType(type); block.info.ID = BehaviorLabController.GetShared().NextBlockID(); block.transform.SetPositionAndRotation(gameObject.transform.position, gameObject.transform.rotation); DragAndDropController.Instance().Grab(block); BehaviorLabController.GetShared().AddBlock(block); } }