// 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 void updateMovingManipulation() { if (moveScript.gridModus) { if (Input.GetKeyUp("left")) { moveScript.goToNextAvailablePositionLeft(); } if (Input.GetKeyUp("right")) { moveScript.goToNextAvailablePositionRight(); } if (Input.GetKeyUp("up")) { moveScript.goToNextAvailablePositionTop(); } if (Input.GetKeyUp("down")) { moveScript.goToNextAvailablePositionDown(); } } else { if (Input.GetKey("left")) { moveScript.goToLeft(); } if (Input.GetKey("right")) { moveScript.goToRight(); } if (Input.GetKey("up")) { moveScript.goToTop(); } if (Input.GetKey("down")) { moveScript.goToBottom(); } } if (Input.GetKeyUp("i") && moveScript.gridModus) /* WIIMOTE | NOT IMPLEMENTED */ { moveScript.goToNextAvailablePosition(); // scrolling left-right, bottom-up } if (Input.GetKeyUp("o")) /* IMPLEMENTED */ { moveScript.End(); // end this manipulation modus = Modi.CHO_MAN; } if (lastHooveredGameObject && (ObjectScript)lastHooveredGameObject.GetComponent("ObjectScript")) { ((ObjectScript)lastHooveredGameObject.GetComponent("ObjectScript")).hooverThis(false); } GameObject newParent = raycastscript.getTargetObjects(Input.mousePosition, playerCam.camera); if (newParent != null) /* TODO: Not implemented -> Needed? */ { lastHooveredGameObject = newParent; if (((ObjectScript)newParent.GetComponent("ObjectScript"))) { ((ObjectScript)newParent.GetComponent("ObjectScript")).hooverThis(true); } if (Input.GetButton("Fire1")) //click { moveScript.changeStackParent(selectieScript.lastGameObjectHit, newParent); } } else { lastHooveredGameObject = null; } }