質問編集履歴

4

質問の追記

2022/05/14 09:25

投稿

assam00
assam00

スコア1

test CHANGED
File without changes
test CHANGED
@@ -16,6 +16,8 @@
16
16
  Assets>SrandardAssets>Utility>EventSystemChecker.csにて、
17
17
  18行目 obj.AddComponent<StandaloneInputModule>().forceModuleActive = true;に旧型式ですとの表記がありました。
18
18
  関係ないかもしれないですが追記しておきます。
19
+
20
+ 該当箇所のスクリーンショットを追加しました。
19
21
 
20
22
  Timer.cs
21
23
  ```C#
@@ -72,3 +74,5 @@
72
74
  }
73
75
  }
74
76
  ```
77
+ ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-05-14/316fd980-369f-4a85-8824-8b1afd2523f7.png)
78
+ ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-05-14/f490ca2f-e3ea-4a11-8e1b-dd20789a1689.png)

3

質問の補足

2022/05/14 09:10

投稿

assam00
assam00

スコア1

test CHANGED
File without changes
test CHANGED
@@ -12,6 +12,12 @@
12
12
  ヒエラルキー内でMain>Canvas>TimerTextのようにUIオブジェクトを作成し、
13
13
  TimerTextにスクリプトをアタッチしました。
14
14
 
15
+ アセットストアにてStandard Assets (for Unity 2018.4)を使用しているのですが、
16
+ Assets>SrandardAssets>Utility>EventSystemChecker.csにて、
17
+ 18行目 obj.AddComponent<StandaloneInputModule>().forceModuleActive = true;に旧型式ですとの表記がありました。
18
+ 関係ないかもしれないですが追記しておきます。
19
+
20
+ Timer.cs
15
21
  ```C#
16
22
  using System.Collections;
17
23
  using System.Collections.Generic;
@@ -41,3 +47,28 @@
41
47
  }
42
48
 
43
49
  ```
50
+
51
+ EventSystemChecker.cs
52
+ ```C#
53
+ using System;
54
+ using System.Collections;
55
+ using UnityEngine;
56
+ using UnityEngine.EventSystems;
57
+
58
+ public class EventSystemChecker : MonoBehaviour
59
+ {
60
+ //public GameObject eventSystem;
61
+
62
+ // Use this for initialization
63
+ void Awake ()
64
+ {
65
+ if(!FindObjectOfType<EventSystem>())
66
+ {
67
+ //Instantiate(eventSystem);
68
+ GameObject obj = new GameObject("EventSystem");
69
+ obj.AddComponent<EventSystem>();
70
+ obj.AddComponent<StandaloneInputModule>().forceModuleActive = true;
71
+ }
72
+ }
73
+ }
74
+ ```

2

質問の補足

2022/05/14 09:01

投稿

assam00
assam00

スコア1

test CHANGED
File without changes
test CHANGED
@@ -9,6 +9,8 @@
9
9
 
10
10
  追記
11
11
  該当するコードはこちらで全文なのですが、こちらのスクリプトをUnityでアタッチした際に動かなくなるという質問です。
12
+ ヒエラルキー内でMain>Canvas>TimerTextのようにUIオブジェクトを作成し、
13
+ TimerTextにスクリプトをアタッチしました。
12
14
 
13
15
  ```C#
14
16
  using System.Collections;

1

質問内容の補足

2022/05/14 08:58

投稿

assam00
assam00

スコア1

test CHANGED
File without changes
test CHANGED
@@ -7,6 +7,8 @@
7
7
  バージョン 
8
8
  Unity 2021.3.2f1 personal
9
9
 
10
+ 追記
11
+ 該当するコードはこちらで全文なのですが、こちらのスクリプトをUnityでアタッチした際に動かなくなるという質問です。
10
12
 
11
13
  ```C#
12
14
  using System.Collections;