示例#1
0
        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);
        }
示例#2
0
 public void onCameraMove(CameraEventData data)
 {
     //Debug.Log(data.new_position.ToString());
     RotateSprite2Camera(data);
 }
示例#3
0
 public void onCameraRotate(CameraEventData data)
 {
     //Debug.Log(data.angle);
     RotateSprite2Camera(data);
 }