Exemplo n.º 1
0
        public bool Equals(Pack other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(PackRules.OrderBy(pr => pr.Identity).SequenceEqual(other.PackRules.OrderBy(pr => pr.Identity)) &&
                   Equals(FrontImage, other.FrontImage) &&
                   Equals(BackImage, other.BackImage) &&
                   Equals(BackImage4K, other.BackImage4K) &&
                   Equals(HighlightImage, other.HighlightImage) &&
                   Equals(HighlightImage4K, other.HighlightImage4K) &&
                   Equals(FrontImage4K, other.FrontImage4K) &&
                   string.Equals(StackGroup, other.StackGroup) &&
                   InventorySortPriority == other.InventorySortPriority &&
                   Equals(DisplayInfo, other.DisplayInfo) &&
                   string.Equals(MarketplaceProductId, other.MarketplaceProductId) &&
                   string.Equals(ProductId, other.ProductId));
        }
Exemplo n.º 2
0
    public IEnumerator Init(GameObject parent)
    {
        this.gameObject.transform.SetParent(parent.transform);

#if UNITY_EDITOR
        editorUseAssetBundle = false;
        if (!editorUseAssetBundle)
        {
            yield break;
        }
#endif

        baseDownloaderURL = Application.streamingAssetsPath + "/";
        if (Application.platform == RuntimePlatform.Android)
        {
            baseDownloaderURL = Application.dataPath + "!assets/";
        }

        string manifestPath;

        if (Application.platform == RuntimePlatform.Android)
        {
            manifestPath = baseDownloaderURL + "Android";
        }
        else if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            manifestPath = baseDownloaderURL + "iOS";
        }
        else
        {
            manifestPath = baseDownloaderURL + "StandaloneWindows";
        }

        // TODO: 处理更新补丁

        AssetBundle ab = AssetBundle.LoadFromFile(manifestPath);
        if (ab == null)
        {
            Debug.LogError("manifest not found!");
            yield break;
        }

        assetBundleManifest = ab.LoadAsset <AssetBundleManifest>("AssetBundleManifest");
        ab.Unload(false);

        // 加载打包规则
        GameObject go = Resources.Load <GameObject>("Entrance/PackRules");
        packRules = go.GetComponent <PackRules>();

        yield return(null);
    }
Exemplo n.º 3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = PackRules?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (FrontImage != null ? FrontImage.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (BackImage != null ? BackImage.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (BackImage4K != null ? BackImage4K.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HighlightImage != null ? HighlightImage.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HighlightImage4K != null ? HighlightImage4K.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FrontImage4K != null ? FrontImage4K.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StackGroup?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ InventorySortPriority;
         hashCode = (hashCode * 397) ^ (DisplayInfo != null ? DisplayInfo.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MarketplaceProductId?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (ProductId?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
Exemplo n.º 4
0
    static void LoadPackRules()
    {
        GameObject obj = Resources.Load("Entrance/PackRules") as GameObject;

        PackRules = obj.GetComponent <PackRules>();
    }