मैं कैनवस के बाहर (गैर यूआई ऑब्जेक्ट – वास्तविक गेमऑब्जेक्ट) विभिन्न स्क्रीन आकारों के अनुसार यूनिटी इंजन में गेमऑब्जेक्ट को कैसे स्केल करूं?


 I want to consider the edges/borders of the screens and place the gameObject accordingly with sufficient padding across those edges/borders of screens. Also I have to keep the scale(x & y) equal. 
I have to prevent it from being bigger or smaller and getting out of the view or overlapping with other objects in the game scene. BTW it's a 2D game.

मैंने क्या प्रयास किया है:

I have tried Camera.main.ScreenToWorldPoint but don't know how to guide it to get what I want. And I don't think it would be sufficient to do that.

समाधान 2

समाधान 3

एक खाली यूआई गेमऑब्जेक्ट का उपयोग करें और कैनवास को गणित करने दें, स्क्रिप्ट के माध्यम से इस यूआई खाली गेमऑब्जेक्ट पर वांछित गेमऑब्जेक्ट (गैर यूआई) स्थिति सेट करें 🙂

コメント

タイトルとURLをコピーしました