InvexGames / MaterialUI

MaterialUI is a UI kit for Unity that follows Google's official material design guidelines.
http://invexgames.com/materialUI.html
Other
771 stars 200 forks source link

Things don't work as expected when using 'Screen Space -Camera' render mode. #45

Open Benjiko99 opened 9 years ago

Benjiko99 commented 9 years ago

Ripples don't render properly on some objects in the Game view (fine in Scene).

Gyazo

Gyazo Here the first element doesn't work, and others only work when clicked on certain spots (not clicking on the icon in the first ones and not clicking on the text in the later ones).

InvexGames commented 9 years ago

I'll take a look when I can :)

InvexGames commented 9 years ago

I can't seem to reproduce this. Would you mind sending me a copy of your scene/project?

Benjiko99 commented 9 years ago

Sure https://mega.co.nz/#!C0wEHT6Q!a55O_bp5IK9YJp54sGu8rcwitZSjjfRgq035qS7o65E sorry for late reply.

dmxride commented 9 years ago

Firs of all thanks a lot InvexGames, your hard work really helped out our team of university students with not that much time to develop an app ;)

Benjiko99, to solve your problem, when setting render mode to 'Screen Space -Camera' , you can just adjust the canvas plane distance to 40, worked for us :D

Good Luck ;)

Benjiko99 commented 9 years ago

@dmxride Changing the plane distance worked. The problem is that ripples are being created many units infront of where they should be, as seen here

dmxride commented 9 years ago

Yeap, i also had to set the camera to ortographic so it would work on different resolutions and i had to change the on Drag method from the script NavDrawerConfig.cs to this, else it would kinda be messed up

public void OnDrag(PointerEventData data) { tempVector2 = new Vector2 (thisRectTransform.position.x, thisRectTransform.position.y); tempVector2.x += data.delta.x;

    //  thisRectTransform.position = tempVector2;

        backgroundCanvasGroup.alpha = 1 - (maxPosition - thisRectTransform.anchoredPosition.x) / (maxPosition - minPosition);
        shadowCanvasGroup.alpha = 1 - (maxPosition - thisRectTransform.anchoredPosition.x) / ((maxPosition - minPosition) * 2);
    }
Benjiko99 commented 9 years ago

I have actually posted a fix for the nav drawer 19 days ago :) https://github.com/InvexGames/MaterialUI/pull/44/files

dmxride commented 9 years ago

Yeap, awesome, better than my approach, thanks a lot @Benjiko99 ;)

InvexGames commented 9 years ago

Hi! Thanks for bringing this issue to my attention :)

I'm now working on MaterialUI in a private repo, adding features and the likes for an official release on the Asset Store - this means that I won't be adding/fixing anything more in this repo (sorry). Feel free to fork this one if you'd like to tackle to issue yourself, and/or send me an email at invex@invexgames.com if you want me to let you know when it's available.

Cheers, Declan.