/// <summary> /// Sets the handle. /// </summary> /// <param name="value">Value.</param> protected virtual void SetHandle(GameObject value) { if (handle) { Destroy(handleScript); } handle = value; handleScript = handle.AddComponent <DraggableHandle>(); handleScript.Drag(gameObject.transform as RectTransform); }
/// <summary> /// Sets the handle. /// </summary> /// <param name="value">Value.</param> protected virtual void SetHandle(GameObject value) { if (handle != null) { Destroy(handleScript); } handle = value; handleScript = Utilites.GetOrAddComponent <DraggableHandle>(handle); handleScript.Drag(gameObject.transform as RectTransform); }