-
Notifications
You must be signed in to change notification settings - Fork 1
/
Scr.cs
48 lines (31 loc) · 1023 Bytes
/
Scr.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class Scr : MonoBehaviour {
Scrollbar tx;
GameObject targetObject;
public GameObject temp;
//控制魔術方塊每一格所要縮放的數值
Scrollbar bar;
// Use this for initialization
void Start () {
temp = GameObject.Find("Scrollbar");
targetObject = GameObject.Find("MagicCube");
}
public float minFov = 15f;
public float maxFov = 15f;
public float sensitivity =25;
public bool change_bool = false;
float sensitivitytmp;
void Update()
{
bar = temp.GetComponent<Scrollbar>();
if (bar.value != sensitivitytmp)
{
object[] msgArrCS2 = new object[1];
msgArrCS2[0] = 0.1f + (bar.value * 1.8f);
sensitivitytmp = (float)msgArrCS2[0];
targetObject.SendMessage("set_speed", msgArrCS2);
}
}
}