Ejemplo n.º 1
0
        public NoteItem()
        {
            mathUtil = new LineMathUtil();

            mathUtil.paramA = 0;
            mathUtil.paramB = 45;

            mathUtil.ratioY = 0.185f;

            mathUtil.ix = -360;
            mathUtil.dx = 1.96f;
            mathUtil.ix = 0;
            mathUtil.dx = 0;

            mathUtil.iz = 1719;
            mathUtil.dz = -17.5f;
        }
Ejemplo n.º 2
0
        public void CreateSpriteView(Transform panelTransform, PrefabFactory factoryPrefab)
        {
            if (factoryPrefab == null)
            {
                return;
            }
            if (panelTransform == null)
            {
                return;
            }

            view = factoryPrefab.GetNoteSprite();
            view.transform.SetParent(panelTransform);
            view.transform.localScale = new Vector3(100, 100, 100);

            mathUtil.ix = (xId - 2) * 320;

            this.panelTransform = panelTransform;

            // ラインインスタンス
            if (state == NoteState.KillLinkStart)
            {
                lineEffect = factoryPrefab.GetLineEffect();
                lineEffect.init();
            }

            // 同時連結ノーツの場合にラインを生成します
            if (hasLine)
            {
                lineMathUtil = mathUtil.Clone();

                var centerX = (float)xId + (float)lineLength * 0.5f;
                lineMathUtil.ix = (centerX - 2) * 320;

                connecter = factoryPrefab.GetNoteConnecter();
                connecter.transform.SetParent(panelTransform);
                connecter.transform.localScale = new Vector3(100, 100, 100);
            }
        }
        public void updateMesh(int num, float startRatio, float endRatio)
        {
            if (mathUtil == null)
            {
                mathUtil = new LineMathUtil();
            }

            vertices  = new List <Vector3>();
            uvs       = new List <Vector2>();
            triangles = new List <int>();

            if (!mesh)
            {
                mesh = new Mesh();
            }

            mesh.uv        = uvs.ToArray();
            mesh.triangles = triangles.ToArray();
            mesh.vertices  = vertices.ToArray();

            // 関数カーブ
            buildPolygon(num, startRatio, endRatio);
        }