Example #1
0
    /**
     * パーツのαを連動する。
     * @param model
     * @param partsGroup
     */
    public void copyOpacityOtherParts(ALive2DModel model, L2DPartsParam[] partsGroup)
    {
        for (int i_group = 0; i_group < partsGroup.Length; i_group++)
        {
            L2DPartsParam partsParam = partsGroup[i_group];

            if (partsParam.link == null)
            {
                continue;                                 //リンクするパラメータはない
            }
            if (partsParam.partsIndex < 0)
            {
                continue;                                   //存在しないパーツ
            }
            float opacity = model.getPartsOpacity(partsParam.partsIndex);

            for (int i_link = 0; i_link < partsParam.link.Count; i_link++)
            {
                L2DPartsParam linkParts = partsParam.link[i_link];

                if (linkParts.partsIndex < 0)
                {
                    //
                    linkParts.initIndex(model);
                }

                if (linkParts.partsIndex < 0)
                {
                    continue;                                      //
                }
                model.setPartsOpacity(linkParts.partsIndex, opacity);
            }
        }
    }