Ejemplo n.º 1
0
 public void LoadEventItem(
     int itemID,
     PlayState.ItemInfo itemInfo,
     ActionItemInfo eventItemInfo)
 {
     this.LoadEventItem(itemID, itemInfo.parentName, itemInfo.isSync, eventItemInfo);
 }
Ejemplo n.º 2
0
        public GameObject LoadEventItem(
            int itemID,
            string parentName,
            bool isSync,
            ActionItemInfo eventItemInfo)
        {
            GameObject gameObject = (GameObject)null;

            if (Object.op_Inequality((Object)this.CurrentPoint, (Object)null))
            {
                gameObject = this.CurrentPoint.CreateEventItems(itemID, parentName, isSync);
            }
            if (Object.op_Equality((Object)gameObject, (Object)null))
            {
                gameObject = CommonLib.LoadAsset <GameObject>((string)eventItemInfo.assetbundleInfo.assetbundle, (string)eventItemInfo.assetbundleInfo.asset, false, (string)eventItemInfo.assetbundleInfo.manifest);
                if (!MapScene.AssetBundlePaths.Exists((Predicate <ValueTuple <string, string> >)(x => (string)x.Item1 == (string)eventItemInfo.assetbundleInfo.assetbundle && (string)x.Item2 == (string)eventItemInfo.assetbundleInfo.manifest)))
                {
                    MapScene.AssetBundlePaths.Add(new ValueTuple <string, string>((string)eventItemInfo.assetbundleInfo.assetbundle, (string)eventItemInfo.assetbundleInfo.manifest));
                }
            }
            if (Object.op_Inequality((Object)gameObject, (Object)null))
            {
                GameObject loop = ((Component)this.ChaControl.animBody).get_transform().FindLoop(parentName);
                GameObject self = (GameObject)Object.Instantiate <GameObject>((M0)gameObject, loop.get_transform(), false);
                self.SetActiveIfDifferent(true);
                ((Object)self.get_gameObject()).set_name(((Object)gameObject.get_gameObject()).get_name());
                self.get_transform().set_localPosition(Vector3.get_zero());
                self.get_transform().set_localRotation(Quaternion.get_identity());
                self.get_transform().set_localScale(Vector3.get_one());
                this.Animation.Items.Add(new ValueTuple <int, GameObject>(itemID, self));
                Renderer[] componentsInChildren = (Renderer[])self.GetComponentsInChildren <Renderer>();
                foreach (Renderer renderer in componentsInChildren)
                {
                    renderer.set_enabled(false);
                }
                this.Animation.ItemRenderers.Add(new ValueTuple <int, Renderer[]>(itemID, componentsInChildren));
                if (eventItemInfo.existsAnimation)
                {
                    Animator component = (Animator)self.GetComponent <Animator>();
                    RuntimeAnimatorController animatorController = AssetUtility.LoadAsset <RuntimeAnimatorController>(eventItemInfo.animeAssetBundle);
                    component.set_runtimeAnimatorController(animatorController);
                    this.Animation.ItemAnimatorTable[((Object)self).GetInstanceID()] = new ItemAnimInfo()
                    {
                        Animator   = component,
                        Parameters = component.get_parameters(),
                        Sync       = isSync
                    };
                }
                Resources.TriValues triValues;
                if (Singleton <Resources> .Instance.Animation.ItemScaleTable.TryGetValue(itemID, out triValues))
                {
                    this._scaleCtrlInfos.Add(new Actor.ItemScaleInfo()
                    {
                        TargetItem = self,
                        ScaleMode  = triValues.ScaleType,
                        SThreshold = triValues.SThreshold,
                        MThreshold = triValues.MThreshold,
                        LThreshold = triValues.LThreshold
                    });
                }
                return(self);
            }
            AssetBundleInfo assetbundleInfo = eventItemInfo.assetbundleInfo;

            Debug.LogError((object)string.Format("イベントアイテム読み込み失敗: バンドルパス[{0}] プレハブ[{1}] マニフェスト[{2}]", (object)assetbundleInfo.assetbundle, (object)assetbundleInfo.asset, (object)assetbundleInfo.manifest));
            return((GameObject)null);
        }