// Use this for initialization void Start() { if (instance == null) { DontDestroyOnLoad(this.gameObject); instance = this; } else { Destroy(this.gameObject); } // 씬에 맞게 자동으로 할당 if (target == null && GameObject.FindGameObjectWithTag("Mary") != null) target = GameObject.FindGameObjectWithTag("Mary"); if (bound == null && GameObject.FindGameObjectWithTag("Background") != null) bound = GameObject.FindGameObjectWithTag("Background").GetComponent<BoxCollider2D>(); // 각 변수 초기화 zoomCtrl = GetComponent<ZoomInOut>(); getCamera = GetComponent<Camera>(); minBound = bound.bounds.min; maxBound = bound.bounds.max; halfHeight = getCamera.orthographicSize; halfWidth = halfHeight * Screen.width / Screen.height; }
// Use this for initialization void Start() { // TEMP CODE if (!theZoomInOutScript) { theZoomInOutScript = GameObject.Find("CityCanvas").GetComponentInChildren <ZoomInOut>(); } }
// Use this for initialization void Start() { clickedobject = this.GetComponent <Clicked> (); gl = GameObject.Find("ScriptGlobal").GetComponent <Global> (); pa = this.GetComponent <PlayAnimations> (); ins = this.GetComponent <InventorySystem> (); zio = this.GetComponent <ZoomInOut> (); dt = this.GetComponent <DragTurn> (); if (go == null) { go = this.gameObject; } }
// wird aufgerufen wenn eine Zoom-Geste detektiert wurde private void ZoomAction(ZoomInOut hd) { switch (hd) { case ZoomInOut.backwardsDisplay: // Abonennten benachrichtigen über Event-Auslösung LeapZoom?.Invoke(ZoomInOut.backwardsDisplay); break; case ZoomInOut.towardsDisplay: LeapZoom?.Invoke(ZoomInOut.towardsDisplay); break; } }
// is notified when a zooming gesture was detected in the LeapListener class private void ZoomAction(ZoomInOut hd) { // Property of the view (MainWindow) is adapted according to the scaling factor //Triggers Mouse-Events dependent on the detected zoom gesture switch (hd) { case ZoomInOut.backwardsDisplay: Scale -= 1; //MouseInput.ScrollWheel(-1); break; case ZoomInOut.towardsDisplay: Scale += 1; //MouseInput.ScrollWheel(1); break; } }
private void initCamera() { // 씬에 맞게 자동으로 할당 if (target == null && GameObject.FindGameObjectWithTag("Mary") != null) { target = GameObject.FindGameObjectWithTag("Mary"); } if (bound == null && GameObject.FindGameObjectWithTag("Background") != null) { bound = GameObject.FindGameObjectWithTag("Background").GetComponent <BoxCollider2D>(); } // 각 변수 초기화 zoomCtrl = GetComponent <ZoomInOut>(); getCamera = GetComponent <Camera>(); minBound = bound.bounds.min; maxBound = bound.bounds.max; halfHeight = getCamera.orthographicSize; halfWidth = halfHeight * Screen.width / Screen.height; }
// Use this for initialization void Start() { if (instance == null) { DontDestroyOnLoad(this.gameObject); instance = this; } else { Destroy(this.gameObject); } // 각 변수 초기화 zoomCtrl = GetComponent <ZoomInOut>(); getCamera = GetComponent <Camera>(); minBound = bound.bounds.min; maxBound = bound.bounds.max; halfHeight = getCamera.orthographicSize; halfWidth = halfHeight * Screen.width / Screen.height; }
void Awake() { Instance = this; cam = GetComponent <Camera>(); }