private int selected; //for the pick state // Use this for initialization void Start() { canvas.SetActive(false); normalState.SetActive(true); drawingState.SetActive(false); pickState.SetActive(false); wrongState.SetActive(false); editState.SetActive(false); systemState.SetActive(false); canvasOpen = false; predictor = GameObject.FindGameObjectWithTag("Predictor").GetComponent <Predict> (); selector = GameObject.FindGameObjectWithTag("ScaleSelection").GetComponent <Selection> (); scaler = GameObject.FindGameObjectWithTag("ScaleSelection").GetComponent <ScaleScript> (); mapping = new int[10]; mapping [0] = 4; mapping [1] = 6; mapping [2] = 5; mapping [3] = 8; mapping [4] = 10; mapping [5] = 1; mapping [6] = 2; mapping [7] = 3; mapping [8] = 7; mapping [9] = 9; }
// Use this for initialization void Start() { //Init controllers wiimote_start(); //Turn off mouse pointer and set the cursorImage screenpointer = (GUITexture)Instantiate(baseGuiTexture); Screen.showCursor = false; screenpointer.texture = cursorImage; screenpointer.color = Color.red; screenpointer.pixelInset = new Rect(10, 10, 10, 10); screenpointer.transform.localScale -= new Vector3(1, 1, 0); //Set ref scripts raycastscript = gameObject.GetComponent("RayCastScript") as RayCastScript; rotateScript = gameObject.GetComponent("RotateScript") as RotateScript; scaleScript = gameObject.GetComponent("ScaleScript") as ScaleScript; stackScript = gameObject.GetComponent("StackScript") as StackScript; moveScript = gameObject.GetComponent("MoveScript") as MoveScript; smoothCameraScript = gameObject.GetComponent("SmoothCameraScript") as SmoothCameraScript; verwijderScript = gameObject.GetComponent("VerwijderScript") as VerwijderScript; selectieScript = gameObject.GetComponent("SelectieScript") as SelectieScript; //Set initial values selectieScript.setSelectionmodeOn(); selectieScript.playerCam = playerCam; modus = Modi.NAV_SEL; }
// Use this for initialization void Start () { //selectieScript.lastGameObjectHit = null; lastHooveredGameObject = null; //Set ref script raycastscript = gameObject.GetComponent("RayCastScript") as RayCastScript; rotateScript = gameObject.GetComponent("RotateScript") as RotateScript; scaleScript = gameObject.GetComponent("ScaleScript") as ScaleScript; stackScript = gameObject.GetComponent("StackScript") as StackScript; moveScript = gameObject.GetComponent("MoveScript") as MoveScript; smoothCameraScript = gameObject.GetComponent("SmoothCameraScript") as SmoothCameraScript; verwijderScript = gameObject.GetComponent("VerwijderScript") as VerwijderScript; selectieScript = gameObject.GetComponent("SelectieScript") as SelectieScript; selectieScript.setSelectionmodeOn(); selectieScript.playerCam = playerCam; //Turn off mouse pointer and set the cursorImage screenpointer = (GUITexture)Instantiate(baseGuiTexture); Screen.showCursor = false; screenpointer.texture = cursorImage; screenpointer.color = Color.red; screenpointer.pixelInset = new Rect(-5, -5,10,10); screenpointer.transform.localScale -= new Vector3(1, 1, 0); modus = Modi.NAV_SEL; }
//改變尺寸 private IEnumerator ChangeScaleEnumerator(ScaleScript info) { bool playing = true; float timer = 0; //計時器 float endTime = info.GetEndTime(); //動畫結束時間 float denominator = info.GetDenominator(); //動畫進度分母 Vector3[] alteration = new Vector3[2] { info.insOutsScales.Length == 2 ? info.insOutsScales[0] : this.transform.localScale, info.insOutsScales[info.insOutsScales.Length - 1] }; info.insOutsScales = alteration; while (playing) //變化過程 { timer = timer + Time.fixedDeltaTime > endTime ? endTime : timer + Time.fixedDeltaTime; float x = alteration[0].x + ((alteration[1].x - alteration[0].x) * (info.GetNumerator(timer) / denominator)); float y = alteration[0].y + ((alteration[1].y - alteration[0].y) * (info.GetNumerator(timer) / denominator)); float z = alteration[0].z + ((alteration[1].z - alteration[0].z) * (info.GetNumerator(timer) / denominator)); this.transform.localScale = new Vector3(x, y, z); if (timer == endTime) { playing = false; } yield return(new WaitForFixedUpdate()); } info.isPlaying = false; yield return(null); }
void Start() { thisCamera = Camera.main; selectableMask = LayerMask.GetMask("Selectable"); screenCenter = new Vector3(Screen.width / 2, Screen.height / 2); deltaY = new Vector3(0.0f, rayRadius); deltaX = new Vector3(rayRadius, 0.0f); scaleScript = gameObject.GetComponent <ScaleScript> (); }
void Start() { thisCamera = Camera.main; selectableMask = LayerMask.GetMask ("Selectable"); screenCenter = new Vector3 (Screen.width / 2, Screen.height / 2); deltaY = new Vector3 (0.0f, rayRadius); deltaX = new Vector3 (rayRadius, 0.0f); scaleScript = gameObject.GetComponent <ScaleScript> (); }
// Use this for initialization void Start () { //Set ref script raycastscript = gameObject.GetComponent("RayCastScript") as RayCastScript; rotateScript = gameObject.GetComponent("RotateScript") as RotateScript; scaleScript = gameObject.GetComponent("ScaleScript") as ScaleScript; stackScript = gameObject.GetComponent("StackScript") as StackScript; moveScript = gameObject.GetComponent("MoveScript") as MoveScript; //Turn off mouse pointer and set the cursorImage screenpointer = (GUITexture)Instantiate(baseGuiTexture); Screen.showCursor = false; screenpointer.texture = cursorImage; screenpointer.color = Color.red; screenpointer.pixelInset = new Rect(10,10,10,10); screenpointer.transform.localScale -= new Vector3(1, 1, 0); }
// Use this for initialization void Start() { //Set ref script raycastscript = gameObject.GetComponent("RayCastScript") as RayCastScript; rotateScript = gameObject.GetComponent("RotateScript") as RotateScript; scaleScript = gameObject.GetComponent("ScaleScript") as ScaleScript; stackScript = gameObject.GetComponent("StackScript") as StackScript; moveScript = gameObject.GetComponent("MoveScript") as MoveScript; //Turn off mouse pointer and set the cursorImage screenpointer = (GUITexture)Instantiate(baseGuiTexture); Screen.showCursor = false; screenpointer.texture = cursorImage; screenpointer.color = Color.red; screenpointer.pixelInset = new Rect(10, 10, 10, 10); screenpointer.transform.localScale -= new Vector3(1, 1, 0); }
// Use this for initialization void Start() { canvas.SetActive (false); normalState.SetActive (true); drawingState.SetActive (false); pickState.SetActive (false); wrongState.SetActive (false); editState.SetActive (false); systemState.SetActive (false); canvasOpen = false; predictor = GameObject.FindGameObjectWithTag ("Predictor").GetComponent<Predict> (); selector = GameObject.FindGameObjectWithTag ("ScaleSelection").GetComponent<Selection> (); scaler = GameObject.FindGameObjectWithTag ("ScaleSelection").GetComponent<ScaleScript> (); mapping = new int[10]; mapping [0] = 4; mapping [1] = 6; mapping [2] = 5; mapping [3] = 8; mapping [4] = 10; mapping [5] = 1; mapping [6] = 2; mapping [7] = 3; mapping [8] = 7; mapping [9] = 9; }
// Use this for initialization void Start() { //Init controllers wiimote_start(); //Turn off mouse pointer and set the cursorImage screenpointer = (GUITexture)Instantiate(baseGuiTexture); Cursor.visible = false; screenpointer.texture = cursorImage; screenpointer.color = Color.red; screenpointer.pixelInset = new Rect(10,10,10,10); screenpointer.transform.localScale -= new Vector3(1,1,0); //Set ref scripts raycastscript = gameObject.GetComponent("RayCastScript") as RayCastScript; rotateScript = gameObject.GetComponent("RotateScript") as RotateScript; scaleScript = gameObject.GetComponent("ScaleScript") as ScaleScript; stackScript = gameObject.GetComponent("StackScript") as StackScript; moveScript = gameObject.GetComponent("MoveScript") as MoveScript; smoothCameraScript = gameObject.GetComponent("SmoothCameraScript") as SmoothCameraScript; verwijderScript = gameObject.GetComponent("VerwijderScript") as VerwijderScript; selectieScript = gameObject.GetComponent("SelectieScript") as SelectieScript; //Set initial values selectieScript.setSelectionmodeOn(); selectieScript.playerCam = playerCam; modus = Modi.NAV_SEL; }