Пример #1
0
                // 星座変身モード中、毎フレーム呼ばれる
                public void MyUpdate()
                {
                    GameObject nearestAvailableConstellation = constellationManager.GetInRangeNearestConstellation();

                    // カーソル最寄りの星座が変わったら
                    if (lastNearestAvailableConstellation != nearestAvailableConstellation)
                    {
                        constellationManager.ChangeGoldLine(nearestAvailableConstellation, lastNearestAvailableConstellation);
                    }

                    // クリックされたら
                    if (Input.GetMouseButtonDown(0) && nearestAvailableConstellation != null)
                    {
                        // ここで変身関数を呼ぶので書いてください。
                        // nearestAvailableConstellationがUI上の星座オブジェクトです。
                        // nearestAvailableConstellation.GetComponent<ConstellationInfo>().Name でConstelltionTypeを知ることができます。
                    }

                    lastNearestAvailableConstellation = nearestAvailableConstellation;
                }