void RotateSprite2Camera(CameraEventData data) { //offset = (int)CameraFacing.Instance.getFacing(); CalcOffsetToCamera(data.angle); // rotate sprite to camera transform.LookAt(data.new_position); transform.rotation = Quaternion.Euler(0f, transform.rotation.eulerAngles.y, 0f); transform.Rotate(new Vector3(1f, 0, 0), -45f); }
public void onCameraMove(CameraEventData data) { //Debug.Log(data.new_position.ToString()); RotateSprite2Camera(data); }
public void onCameraRotate(CameraEventData data) { //Debug.Log(data.angle); RotateSprite2Camera(data); }