質問編集履歴

1

情報の追加

2017/08/16 11:04

投稿

nyanyako
nyanyako

スコア13

test CHANGED
File without changes
test CHANGED
@@ -4,7 +4,33 @@
4
4
 
5
5
  下記のコードでは、z座標しかエクセルに出力できていません。xとy座標も出力させたいのですが、カンマ区切りで一緒に出力させる方法がわかりません。
6
6
 
7
+
8
+
7
- また、下記のコードではUnityのCubeのinspectorに表示されているRotation Zとエクセルに出力されている値が異なります。これはなぜでしょうか?
9
+ また、下記のコードではUnityのCubeのinspectorに表示されているRotation Zとエクセルに出力されている値が異なります。
10
+
11
+ inspectorには1秒ごとに0、5、10…のように5刻みの値が表示されます。
12
+
13
+ エクセルファイルには
14
+
15
+ 0.043619
16
+
17
+ 0.087156
18
+
19
+ 0.130526
20
+
21
+ 0.173648
22
+
23
+ 0.21644
24
+
25
+ 0.258819
26
+
27
+ 0.300706
28
+
29
+ 0.34202
30
+
31
+ のように値が入ります。
32
+
33
+ inspectorに表示されている値をエクセルファイルに出力させたいのですが、なぜかがわかりません。
8
34
 
9
35
 
10
36
 
@@ -14,19 +40,53 @@
14
40
 
15
41
  ```C#
16
42
 
43
+ using System.Collections;
44
+
45
+ using System.Collections.Generic;
46
+
17
47
  using UnityEngine;
18
-
19
- using System.Collections;
20
48
 
21
49
 
22
50
 
23
- public class RotateCube : MonoBehaviour {
51
+ public class Rotatecube : MonoBehaviour {
52
+
53
+ private float timeleft;
54
+
55
+ // Use this for initialization
56
+
57
+ void Start () {
58
+
59
+
60
+
61
+ }
24
62
 
25
63
 
26
64
 
27
- void Update () {
65
+ // Update is called once per frame
28
66
 
67
+ void Update()
68
+
69
+ {
70
+
71
+
72
+
73
+ //だいたい1秒ごとに処理を行う
74
+
75
+ timeleft -= Time.deltaTime;
76
+
77
+ if (timeleft <= 0.0) {
78
+
79
+ timeleft = 1.0f;
80
+
81
+
82
+
83
+ //ここに処理
84
+
29
- transform.Rotate(new Vector3(0, 0, 5));
85
+ transform.Rotate(new Vector3(0, 0, 5));
86
+
87
+ }
88
+
89
+
30
90
 
31
91
  }
32
92
 
@@ -48,7 +108,7 @@
48
108
 
49
109
  public class log : MonoBehaviour
50
110
 
51
- { // float timex;
111
+ {
52
112
 
53
113
  // Use this for initialization
54
114