Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created April 24, 2018 10:02
Show Gist options
  • Save todorok1/46093113fb21be3f788534a8899445c7 to your computer and use it in GitHub Desktop.
Save todorok1/46093113fb21be3f788534a8899445c7 to your computer and use it in GitHub Desktop.
Unityチュートリアル・角度に合わせて矢印を動かすスクリプト。
void ChangeArrowAngle(){
// 角度の矢印をボールの位置に移動
arrowRt.position = RectTransformUtility.WorldToScreenPoint(Camera.main, transform.position);
// Z軸を中心に、forceAngleの値の回転を作って角度の矢印にセット
arrowRt.rotation = Quaternion.AngleAxis(forceAngle, Vector3.forward);
// GuideManagerのSetGuidePositions()を呼んでガイドを移動させる
if (!isFlying){
guideManager.SetGuidePositions();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment