コード例 #1
0
        // Token: 0x06003899 RID: 14489 RVA: 0x000C9098 File Offset: 0x000C7298
        public void BindAsLocal(int slotNumber, ref global::ModViewModelAddArgs args, global::ItemRepresentation itemRep)
        {
            switch (slotNumber)
            {
            case 0:
                itemRep.BindModAsLocal(ref this.a, ref args);
                break;

            case 1:
                itemRep.BindModAsLocal(ref this.b, ref args);
                break;

            case 2:
                itemRep.BindModAsLocal(ref this.c, ref args);
                break;

            case 3:
                itemRep.BindModAsLocal(ref this.d, ref args);
                break;

            case 4:
                itemRep.BindModAsLocal(ref this.e, ref args);
                break;

            default:
                throw new IndexOutOfRangeException();
            }
        }
コード例 #2
0
    // Token: 0x0600388A RID: 14474 RVA: 0x000C8C84 File Offset: 0x000C6E84
    private void RunViewModelAdd(global::ViewModel vm, global::IHeldItem item, bool doMeshes)
    {
        global::ModViewModelAddArgs modViewModelAddArgs = new global::ModViewModelAddArgs(vm, item, doMeshes);

        for (int i = 0; i < 5; i++)
        {
            this._itemMods.BindAsLocal(i, ref modViewModelAddArgs, this);
        }
    }
コード例 #3
0
 // Token: 0x0600385C RID: 14428 RVA: 0x000C8050 File Offset: 0x000C6250
 private void BindModAsLocal(ref global::ItemRepresentation.ItemModPair pair, ref global::ModViewModelAddArgs a)
 {
     if ((int)pair.bindState == 2)
     {
         this.UnBindModAsProxy(ref pair);
     }
     if ((int)pair.bindState == 1 || (int)pair.bindState == 3)
     {
         a.modRep = pair.representation;
         pair.dataBlock.BindAsLocal(ref a);
         pair.bindState = global::ItemRepresentation.BindState.Local;
     }
 }
コード例 #4
0
 // Token: 0x0600357D RID: 13693 RVA: 0x000C4494 File Offset: 0x000C2694
 protected override bool InstallToViewModel(ref global::ModViewModelAddArgs a)
 {
     if (this.isMesh && !a.isMesh)
     {
         return(base.InstallToViewModel(ref a));
     }
     if (!this.isMesh && a.isMesh)
     {
         return(base.InstallToViewModel(ref a));
     }
     if (a.vm == null)
     {
         Debug.Log("Viewmodel null for item attachment...");
     }
     if (this.attachObjectVM != null)
     {
         global::WeaponModRep weaponModRep = (global::WeaponModRep)a.modRep;
         GameObject           gameObject;
         if (a.isMesh)
         {
             global::Socket socketByName = this.GetSocketByName(a.vm, this.attachSocketName);
             gameObject = (Object.Instantiate(this.attachObjectVM, socketByName.offset, Quaternion.Euler(socketByName.eulerRotate)) as GameObject);
             gameObject.transform.parent           = socketByName.parent;
             gameObject.transform.localPosition    = socketByName.offset;
             gameObject.transform.localEulerAngles = socketByName.eulerRotate;
         }
         else
         {
             gameObject = this.GetSocketByName(a.vm, this.attachSocketName).InstantiateAsChild(this.attachObjectVM, true);
         }
         gameObject.name = this.attachObjectVM.name;
         weaponModRep.SetAttached(gameObject, true);
         global::ViewModelAttachment component = gameObject.GetComponent <global::ViewModelAttachment>();
         if (component)
         {
             if (this.socketOverrideName != string.Empty && component is global::VMAttachmentSocketOverride)
             {
                 global::VMAttachmentSocketOverride vmattachmentSocketOverride = (global::VMAttachmentSocketOverride)component;
                 this.SetSocketByname(a.vm, this.socketOverrideName, vmattachmentSocketOverride.socketOverride);
                 if (this.modifyZoomOffset)
                 {
                     a.vm.punchScalar  = this.punchScalar;
                     a.vm.zoomOffset.z = this.zoomOffsetZ;
                 }
             }
             component.viewModel = a.vm;
         }
     }
     return(true);
 }
コード例 #5
0
 // Token: 0x060035A6 RID: 13734 RVA: 0x000C4A60 File Offset: 0x000C2C60
 internal void BindAsLocal(ref global::ModViewModelAddArgs a)
 {
     this.InstallToViewModel(ref a);
 }
コード例 #6
0
 // Token: 0x060035AB RID: 13739 RVA: 0x000C4A84 File Offset: 0x000C2C84
 protected virtual bool InstallToViewModel(ref global::ModViewModelAddArgs a)
 {
     return(false);
 }
コード例 #7
0
 // Token: 0x060035CF RID: 13775 RVA: 0x000C4C04 File Offset: 0x000C2E04
 public ModViewModelAddArgs(global::ViewModel vm, global::IHeldItem item, bool isMesh)
 {
     this = new global::ModViewModelAddArgs(vm, item, isMesh, null);
 }