teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

修正

2021/07/21 02:34

投稿

otaaa
otaaa

スコア19

title CHANGED
File without changes
body CHANGED
@@ -11,20 +11,34 @@
11
11
  ・Unity 2021.1.15、2020.3.14f1、 2018.4.36f1で上記のことを試す。
12
12
 
13
13
  ```test.cs
14
+ #define ENABLE_WINMD_SUPPORT
14
15
  using UnityEngine;
15
16
  using System.Collections;
16
17
 
18
+
17
- public class test : MonoBehaviour {
19
+ public class test : MonoBehaviour
20
+ {
21
+
18
- void Start() {
22
+ void Start()
23
+ {
24
+
25
+
26
+
27
+
19
- #if ENABLE_WINMD_SUPPORT
28
+ #if ENABLE_WINMD_SUPPORT
20
- Debug.Log("Windows Runtime Support enabled");
29
+ return Windows.System.UserProfile.AdvertisingManager.AdvertisingId;
21
- #endif
30
+ #endif
31
+
22
- }
32
+ }
23
33
  }
24
34
  ```
25
35
 
26
36
  ### 発生している問題・エラーメッセージ
27
- 以下のサイトを参考に試したのですが、'#if ENABLE_WINMD_SUPPORT'条件が通らずログが表示されません。
37
+ 以下のサイトを参考に試したのですが、Windows.System.UserProfile.AdvertisingManager.AdvertisingIdところで
38
+ ```ここに言語を入力
39
+ Assets\test.cs(27,20): error CS0103: The name 'Windows' does not exist in the current context
40
+ ```
41
+ Windowsがないとエラーが出ます。
28
42
  解決方法がわかる人がいたら教えていただきたいです。
29
43
 
30
44
  参考にしたサイト

1

説明の追加

2021/07/21 02:34

投稿

otaaa
otaaa

スコア19

title CHANGED
File without changes
body CHANGED
@@ -3,16 +3,29 @@
3
3
  univeral windows platformの開発でwindows runtime APIを使いたいと思っています。
4
4
 
5
5
 
6
- ### 発生している問題・エラーメッセージ
7
- 以下のサイトを参考に試したのですが、'#if ENABLE_WINMD_SUPPORT'の条件に通りません。
8
- 解決方法がわかる人がいたら教えていただきたいです。
9
6
 
10
- 参考にしたサイト
11
- [https://docs.unity3d.com/ja/2021.1/Manual/windowsstore-scripts.html](https://docs.unity3d.com/ja/2021.1/Manual/windowsstore-scripts.html)
12
7
 
13
-
14
-
15
8
  ### 試したこと
16
9
  ・Player設定(Edit > Project Settings > Player)でApi Compatibility Level を .NET Standard 2.0 に設定する
17
10
  ・ターゲットのプラットフォームをuniversal windows platformに変更する
18
- ・Unity 2021.1.15、2020.3.14f1、 2018.4.36f1で上記のことを試す。
11
+ ・Unity 2021.1.15、2020.3.14f1、 2018.4.36f1で上記のことを試す。
12
+
13
+ ```test.cs
14
+ using UnityEngine;
15
+ using System.Collections;
16
+
17
+ public class test : MonoBehaviour {
18
+ void Start() {
19
+ #if ENABLE_WINMD_SUPPORT
20
+ Debug.Log("Windows Runtime Support enabled");
21
+ #endif
22
+ }
23
+ }
24
+ ```
25
+
26
+ ### 発生している問題・エラーメッセージ
27
+ 以下のサイトを参考に試したのですが、'#if ENABLE_WINMD_SUPPORT'の条件が通らず、ログが表示されません。
28
+ 解決方法がわかる人がいたら教えていただきたいです。
29
+
30
+ 参考にしたサイト
31
+ [https://docs.unity3d.com/ja/2021.1/Manual/windowsstore-scripts.html](https://docs.unity3d.com/ja/2021.1/Manual/windowsstore-scripts.html)