コード例 #1
0
    private static void BindRenderer <TArmorModel>(ArmorModelRenderer prefabRenderer, ArmorDataBlock armor, MeshFilter filter, MeshRenderer renderer) where TArmorModel : ArmorModel <TArmorModel>, new()
    {
        TArmorModel armorModel;

        if (armor != null)
        {
            armorModel = armor.GetArmorModel <TArmorModel>();
            if ((armorModel == null) && (prefabRenderer != null))
            {
                armorModel = prefabRenderer.GetArmorModel <TArmorModel>();
            }
        }
        else if (prefabRenderer != null)
        {
            armorModel = prefabRenderer.GetArmorModel <TArmorModel>();
        }
        else
        {
            return;
        }
        if (armorModel != null)
        {
            Mesh mesh;
            if (ArmorModelRenderer.Censored && (armorModel.censoredModel != null))
            {
                armorModel = armorModel.censoredModel;
            }
            if ((armorModel != null) && armorModel.actorMeshInfo.FindPose("sleep", out mesh))
            {
                filter.sharedMesh        = mesh;
                renderer.sharedMaterials = armorModel.sharedMaterials;
            }
        }
    }
コード例 #2
0
    public static ArmorModel GetArmorModelByUniqueID(int uniqueID, ArmorModelSlot slot)
    {
        ArmorDataBlock byUniqueID = GetByUniqueID(uniqueID) as ArmorDataBlock;

        if (byUniqueID == null)
        {
            return(null);
        }
        return(byUniqueID.GetArmorModel(slot));
    }
コード例 #3
0
    public static TArmorModel GetArmorModelByUniqueID <TArmorModel>(int uniqueID) where TArmorModel : ArmorModel, new()
    {
        ArmorDataBlock byUniqueID = GetByUniqueID(uniqueID) as ArmorDataBlock;

        if (byUniqueID == null)
        {
            return(null);
        }
        return(byUniqueID.GetArmorModel <TArmorModel>());
    }
コード例 #4
0
    public static ArmorModel GetArmorModelByUniqueID(int uniqueID, ArmorModelSlot slot)
    {
        ArmorDataBlock byUniqueID = DatablockDictionary.GetByUniqueID(uniqueID) as ArmorDataBlock;

        if (!byUniqueID)
        {
            return(null);
        }
        return(byUniqueID.GetArmorModel(slot));
    }
コード例 #5
0
    public static TArmorModel GetArmorModelByUniqueID <TArmorModel>(int uniqueID)
        where TArmorModel : ArmorModel, new()
    {
        ArmorDataBlock byUniqueID = DatablockDictionary.GetByUniqueID(uniqueID) as ArmorDataBlock;

        if (!byUniqueID)
        {
            return((TArmorModel)null);
        }
        return(byUniqueID.GetArmorModel <TArmorModel>());
    }
コード例 #6
0
 private static bool BindArmorMap <TArmorModel>(ArmorDataBlock armor, ref ArmorModelMemberMap map) where TArmorModel : ArmorModel, new()
 {
     if (armor != null)
     {
         TArmorModel armorModel = armor.GetArmorModel <TArmorModel>();
         if (armorModel != null)
         {
             map.SetArmorModel <TArmorModel>(armorModel);
             return(true);
         }
     }
     return(false);
 }