Example #1
0
 public void AddView(int itemId, Transform view)
 {
     UpgradeViewReceiver.UpgradeViewData upgradeViewData = new UpgradeViewReceiver.UpgradeViewData
     {
         ItemId = itemId,
         Position = view.localPosition,
         Rotation = view.localRotation
     };
     this._currentUpgrades.Add(upgradeViewData);
     this._upgradeCount = this._currentUpgrades.Count;
     this.SpawnMirrored(upgradeViewData);
 }
Example #2
0
 private void SpawnMirrored(UpgradeViewReceiver.UpgradeViewData upgradeViewData)
 {
     if (this._mirrorHeld != null)
     {
         Transform transform = UnityEngine.Object.Instantiate <Transform>(this._upgradeCog.SupportedItemsCache[upgradeViewData.ItemId]._prefab);
         transform.parent        = this._mirrorHeld;
         transform.localPosition = upgradeViewData.Position;
         transform.localRotation = upgradeViewData.Rotation;
     }
     if (this._mirrorInventory != null)
     {
         Transform transform = UnityEngine.Object.Instantiate <Transform>(this._upgradeCog.SupportedItemsCache[upgradeViewData.ItemId]._prefab);
         transform.parent        = this._mirrorInventory;
         transform.localPosition = upgradeViewData.Position;
         transform.localRotation = upgradeViewData.Rotation;
     }
 }