Exemple #1
0
 public HatDefinition(BundleDefinition Bundle, string Name, Vector2 ChipOffset, bool InFront = true)
     : this(Bundle.Sprite(Name),
            Bundle.Sprite($"{Name}Back"),
            Bundle.Sprite($"{Name}Floor"),
            Name, ChipOffset, InFront)
 {
 }
Exemple #2
0
 public PetDefinition(BundleDefinition Bundle, string Name, float YOffset = -0.1f)
     : this(Bundle.Object(Name),
            Bundle.Animation($"{Name}Idle"),
            Bundle.Animation($"{Name}Sad"),
            Bundle.Animation($"{Name}Scared"),
            Bundle.Animation($"{Name}Walk"),
            Name, YOffset)
 {
 }
Exemple #3
0
    private static string CreateTempDLL(BundleDefinition bundle, AssetDefinition assetDefinition)
    {
        byte[] bytes = File.ReadAllBytes(assetDefinition.path);
        string path  = assetDefinition.path.Substring(0, assetDefinition.path.Length - 3) + "bytes";

        Debug.Log($"AssetCompiler: Creating dll text asset at '{path}'");
        File.WriteAllBytes(path, bytes);
        AssetDatabase.Refresh();
        return(path);
    }
Exemple #4
0
 public Gun(BundleDefinition Bundle, string Name, int Damage, int Cooldown, float Distance,
            Sprite ButtonIcon, ButtonTargeter Targeter, Color OutlineColor)
 {
     this.Damage       = Damage;
     this.Cooldown     = Cooldown;
     this.Distance     = Distance;
     this.Targeter     = Targeter;
     this.OutlineColor = OutlineColor;
     this.ButtonIcon   = ButtonIcon;
     Icon = Bundle.Sprite(Name);
 }
Exemple #5
0
    public void Add(string source, bool excludeFromBundle            = false,
                    Dictionary <string, string> additionalProperties = null)
    {
        var bundleDefinition = new BundleDefinition
        {
            Source            = source,
            ExcludeFromBundle = excludeFromBundle
        };

        if (additionalProperties != null)
        {
            bundleDefinition.AdditionalProperties = additionalProperties;
        }

        BundleDefinitions.AddIfNotContains((item) => item.Source == bundleDefinition.Source,
                                           () => bundleDefinition);
    }
Exemple #6
0
    private static AssetBundleBuild[] CustomCreateAssetBundleBuildMap(
        IEnumerable <string> abNames,
        ICollection <string> tempFilenames)
    {
        Log("Creating Asset Bundle BuildMaps");
        List <AssetBundleBuild> assetBundleBuildList = new List <AssetBundleBuild>();

        foreach (string abName in abNames)
        {
            string path = AssetCompiler.CreateXML(abName);
            Log($"Created XML file: {path}");
            BundleDefinition bundle = BundleDefinition.LoadFromFile(path);
            List <string>    assets = new List <string>();
            foreach (AssetDefinition asset in bundle.assets)
            {
                // never going to use DLLs inside Bundles I think, prob could ditch this code
                if (asset.type == "dll")
                {
                    Log($"Adding DLL asset: {asset.path}");
                    string tempDll = CreateTempDLL(bundle, asset);
                    tempFilenames.Add(tempDll);
                    assets.Add(tempDll);
                }
                else
                {
                    Log($"Adding regular asset: {asset.path}");
                    assets.Add(asset.path);
                }
            }

            Log($"Adding bundle definition asset: {abName}");
            assets.Add(AssetCompiler.ApplicationXMLFilePath(abName));
            // Not completely sure we need dependencies?
            Log("Adding dependencies.");
            bundle.dependencyNames = new List <string>(GetDependencyBundles(bundle.name, assets));
            bundle.Save(path);
            AssetBundleBuild buildMap = new AssetBundleBuild {
                assetBundleName = abName, assetNames = assets.ToArray()
            };
            assetBundleBuildList.Add(buildMap);
        }

        return(assetBundleBuildList.ToArray());
    }
Exemple #7
0
 public IEnumerable LoadAsset(string name)
 {
     if (loaded_assets.ContainsKey(name))
     {
         yield break;
     }
     if (bundle_def == null)
     {
         bundle_def = AssetLoader.GetBundleDefinition(BUNDLE);
     }
     if (bundle_def != null)
     {
         var asset = AssetLoader.GetAssetDefinitionWithName(bundle_def, name);
         if (asset != null)
         {
             foreach (var _ in load(asset))
             {
                 yield return(null);
             }
         }
     }
 }
Exemple #8
0
 public HealthBar(BundleDefinition Bundle, string TeamName)
     : this(Bundle.Object($"{TeamName}Bar"))
 {
 }
Exemple #9
0
 public HatDefinitionSimple(BundleDefinition Bundle, string Name, Vector2 ChipOffset, bool InFront = true)
     : this(Bundle.Sprite(Name), Name, ChipOffset, InFront)
 {
 }
Exemple #10
0
 public EmojiDefinition(BundleDefinition Bundle, string AssetName, params KeyCode[] Keys)
     : this(Bundle.Object(AssetName), Keys)
 {
 }
Exemple #11
0
 public Gun(BundleDefinition Bundle, string Name, int Damage, int Cooldown, float Distance)
     : this(Bundle, Name, Damage, Cooldown, Distance, ExtraResources.SHOOT,
            StandardGunTargeter.INSTANCE, Palette.ImpostorRed)
 {
 }