Shapes2DをAddComponentで動的に追加したいのですが、
角丸デザインが表示されず、通常ボタンのまま、角張ったままになってます。
GameObject obj = GameObject.Find("Button"); Shape shape = obj.AddComponent<Shape>(); shape.settings.roundness = 0.5f; shape.settings.shapeType = ShapeType.Rectangle;
既にGUI上でAddComponentし、以下GetComponentをすると上手く表示されます。
GameObject obj = GameObject.Find("Button"); Shape shape = obj.GetComponent<Shape>(); shape.settings.roundness = 0.5f; shape.settings.shapeType = ShapeType.Rectangle;
ボタンは1000個近くあり、そこに適用したいので、
どうにか動的にAddComponentしたいのですが、
わかる方、返信いただきたいです。
参考:Shapes2Dのドキュメントはこちら
https://sub-c.org/Shapes2D/documentation/index.html?highlight=setting#
#追記20210730
プロジェクトzipです。
https://drive.google.com/file/d/1Mku8_EPZlJdt88Q7Uy_LIX5kGmAO1M_W/view?usp=sharing
プレビュー画面の動画(mov)です。
https://drive.google.com/file/d/148DhzK27sboRL0j0sbhhKeNZNeUzmyJk/view?usp=sharing
プレビュー直後に適用されてません、なぜか、ボタンオブジェクトを選択すると丸くなるのですが、実際iPhoneなどで実行したところ角張った状態となります。
まだ回答がついていません
会員登録して回答してみよう