» unity の記事

~ 2D mouse click on unity ~

connie 2017.03.03 | unity | | No Comments

在要hit test的gameobject內加入Box Collider 2D

01

 // Update is called once per frame
    void Update() {
        if (Input.GetMouseButtonDown(0))
        {
            print("mousedown");

            RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);

            if (hit.collider != null)
            {
                print(hit.collider.gameObject.name);
            }
        }
    }

 

~ Create androidManifest.xml in unity5 ~

connie 2017.02.20 | unity | | No Comments

compile a apk , and go to

C:\{unityProject}/Temp/StagingArea/AndroidManifest.xml
copy to unity->Assets/Plugins/Android

upgrade from jdk 1.7 to 1.8

edit->preference->external Tools->JDK->1.8

 

| HOME | Next Page »

Smiley face

April 2024
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930