Esempio n. 1
0
    static void ApplyDispgroups(uint[] dispgroups, MSBType type)
    {
        var mapPieces = GameObject.Find("MSBParts/MapPieces");

        for (int i = 0; i < mapPieces.transform.childCount; i++)
        {
            var mapPiece = mapPieces.transform.GetChild(i).gameObject;

            if (type == MSBType.MSB3)
            {
                var  comp    = mapPiece.GetComponent <MSB3MapPiecePart>();
                bool visible = ((dispgroups[0] & comp.DispGroup1) != 0) ||
                               ((dispgroups[1] & comp.DispGroup2) != 0) ||
                               ((dispgroups[2] & comp.DispGroup3) != 0) ||
                               ((dispgroups[3] & comp.DispGroup4) != 0) ||
                               ((dispgroups[4] & comp.DispGroup5) != 0) ||
                               ((dispgroups[5] & comp.DispGroup6) != 0) ||
                               ((dispgroups[6] & comp.DispGroup7) != 0) ||
                               ((dispgroups[7] & comp.DispGroup8) != 0);
                mapPiece.SetActive(visible);
            }
            else if (type == MSBType.MSB1)
            {
                var  comp    = mapPiece.GetComponent <MSB1MapPiecePart>();
                bool visible = ((dispgroups[0] & comp.DispGroup1) != 0) ||
                               ((dispgroups[1] & comp.DispGroup2) != 0) ||
                               ((dispgroups[2] & comp.DispGroup3) != 0) ||
                               ((dispgroups[3] & comp.DispGroup4) != 0);
                mapPiece.SetActive(visible);
            }
        }
    }
Esempio n. 2
0
    static string GetModelAssetPath(MSBType type, string name)
    {
        string assetbase = "Assets";

        switch (type)
        {
        case MSBType.MSB1:
            assetbase += "/DS1";
            break;

        case MSBType.MSB2SOTFS:
            assetbase += "/DS2SOTFS";
            break;

        case MSBType.MSB3:
            assetbase += "/DS3";
            break;

        case MSBType.MSBBB:
            assetbase += "/Bloodborne";
            break;

        case MSBType.MSBSekiro:
            assetbase += "/Sekiro";
            break;
        }

        if (name.StartsWith("o"))
        {
            return($@"{assetbase}/Obj/{name}.prefab");
        }
        else if (name.StartsWith("c"))
        {
            return($@"{assetbase}/Chr/{name}.prefab");
        }
        return("");
    }