Inheritance: MonoBehaviour
Ejemplo n.º 1
0
    // 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;



    }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     // TEMP CODE
     if (!theZoomInOutScript)
     {
         theZoomInOutScript = GameObject.Find("CityCanvas").GetComponentInChildren <ZoomInOut>();
     }
 }
Ejemplo n.º 3
0
 // 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;
     }
 }
Ejemplo n.º 4
0
        // 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;
            }
        }
Ejemplo n.º 5
0
        // 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;
            }
        }
Ejemplo n.º 6
0
    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;
    }
Ejemplo n.º 7
0
    // 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;
    }
Ejemplo n.º 8
0
 void Awake()
 {
     Instance = this;
     cam      = GetComponent <Camera>();
 }