2022년 11월 16일 수요일

실수로 git pull 햇을때 로컬 되살리기

 



>[!warning] # 무조건 지켜야 하는 법칙(로컬을 살리기위해,협업을 위해)

> git pull 을 하기전에 

> # **stash** 명령어로 로컬 저장!!

> - 반드시  를 해서 local의 변경사항을 저장하자!!!

> 하지 않는다면 되돌릴수없는 강을 건너게 된다...



2022년 11월 2일 수요일

Unity UI On GameObjectPostion

 




void DrawTest()
    {

        // Offset position above object bbox (in world space)
        float offsetPosY = target.transform.position.y;

        // Final position of marker above GO in world space
        Vector3 offsetPos = new Vector3(target.transform.position.x, offsetPosY, target.transform.position.z);

        // Calculate *screen* position (note, not a canvas/recttransform position)
        Vector2 canvasPos;
        Vector2 screenPoint = Camera.main.WorldToScreenPoint(offsetPos);

        // Convert screen position to Canvas / RectTransform space <- leave camera null if Screen Space Overlay
        RectTransformUtility.ScreenPointToLocalPointInRectangle(MainCanvasRect, screenPoint, null, out canvasPos);

        // Set
        imageRectTransform.localPosition = canvasPos;
    }


DrawLine

 




  // Offset position above object bbox (in world space)
  float offsetPosY = target.transform.position.y + 1.5f;
 
  // Final position of marker above GO in world space
  Vector3 offsetPos = new Vector3(target.transform.position.x, offsetPosY, target.transform.position.z);
 
  // Calculate *screen* position (note, not a canvas/recttransform position)
  Vector2 canvasPos;
  Vector2 screenPoint = Camera.main.WorldToScreenPoint(offsetPos);
 
  // Convert screen position to Canvas / RectTransform space <- leave camera null if Screen Space Overlay
  RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRect, screenPoint, null, out canvasPos);
 
  // Set
  markerRtra.localPosition = canvasPos;



git rejected error(feat. cherry-pick)

 문제 아무 생각 없이 pull을 받지않고 로컬에서 작업! 커밋, 푸시 진행을 해버렷다. push에선 remote와 다르니 당연히 pull을 진행해라고 하지만 로컬에서 작업한 내용을 백업하지 않고 진행하기에는 부담스럽다(로컬작업 유실 가능성) 해결하려...