// Token: 0x060039D6 RID: 14806 RVA: 0x001B98A8 File Offset: 0x001B7CA8 public override void equip() { base.player.animator.play("Equip", true); if (((ItemMeleeAsset)base.player.equipment.asset).isLight) { this.interact = (base.player.equipment.state[0] == 1); if (base.channel.isOwner) { this.firstLightHook = base.player.equipment.firstModel.FindChild("Model_0").FindChild("Light"); this.firstLightHook.tag = "Viewmodel"; this.firstLightHook.gameObject.layer = LayerMasks.VIEWMODEL; Transform transform = this.firstLightHook.FindChild("Light"); if (transform != null) { transform.tag = "Viewmodel"; transform.gameObject.layer = LayerMasks.VIEWMODEL; } PlayerUI.message(EPlayerMessage.LIGHT, string.Empty); } this.thirdLightHook = base.player.equipment.thirdModel.FindChild("Model_0").FindChild("Light"); LightLODTool.applyLightLOD(this.thirdLightHook); if (base.channel.isOwner && this.thirdLightHook != null) { Transform transform2 = this.thirdLightHook.FindChild("Light"); if (transform2 != null) { this.firstFakeLight = UnityEngine.Object.Instantiate <GameObject>(transform2.gameObject).transform; this.firstFakeLight.name = "Emitter"; this.firstFakeLight.parent = Level.effects; } } } else { this.firstLightHook = null; this.thirdLightHook = null; } this.updateAttachments(); if (((ItemMeleeAsset)base.player.equipment.asset).isRepeated) { if (base.channel.isOwner && base.player.equipment.firstModel.FindChild("Hit") != null) { this.firstEmitter = base.player.equipment.firstModel.FindChild("Hit").GetComponent <ParticleSystem>(); this.firstEmitter.tag = "Viewmodel"; this.firstEmitter.gameObject.layer = LayerMasks.VIEWMODEL; } if (base.player.equipment.thirdModel.FindChild("Hit") != null) { this.thirdEmitter = base.player.equipment.thirdModel.FindChild("Hit").GetComponent <ParticleSystem>(); } this.weakTime = (uint)(base.player.animator.getAnimationLength("Start_Swing") / PlayerInput.RATE); this.strongTime = (uint)(base.player.animator.getAnimationLength("Stop_Swing") / PlayerInput.RATE); } else { this.weakTime = (uint)(base.player.animator.getAnimationLength("Weak") / PlayerInput.RATE); this.strongTime = (uint)(base.player.animator.getAnimationLength("Strong") / PlayerInput.RATE); } }
public override void updateState(Asset asset, byte[] state) { this._isLit = (state[0] == 1); this.material = HighlighterTool.getMaterialInstance(base.transform); this.fire = base.transform.FindChild("Fire"); LightLODTool.applyLightLOD(this.fire); this.updateFire(); }
public override void updateState(Asset asset, byte[] state) { base.updateState(asset, state); this._isPowered = (state[0] == 1); if (!Dedicator.isDedicated) { this.material = HighlighterTool.getMaterialInstance(base.transform); this.spot = base.transform.FindChild("Spots"); LightLODTool.applyLightLOD(this.spot); } }
// Token: 0x0600214E RID: 8526 RVA: 0x000B57D0 File Offset: 0x000B3BD0 private void initToggleGameObject() { Transform transform = base.transform.FindChildRecursive("Toggle"); LightLODTool.applyLightLOD(transform); if (transform != null) { this.material = HighlighterTool.getMaterialInstance(transform.parent); this.toggleGameObject = transform.gameObject; } }
// Token: 0x060021A6 RID: 8614 RVA: 0x000B7E62 File Offset: 0x000B6262 public override void updateState(Asset asset, byte[] state) { this._isLit = (state[0] == 1); this.fire = base.transform.FindChild("Fire"); LightLODTool.applyLightLOD(this.fire); }
// Token: 0x060018F4 RID: 6388 RVA: 0x0008BC48 File Offset: 0x0008A048 public void updateAttachments(byte[] state, bool viewmodel) { if (state == null || state.Length != 18) { return; } base.transform.localScale = Vector3.one; this._sightID = BitConverter.ToUInt16(state, 0); this._tacticalID = BitConverter.ToUInt16(state, 2); this._gripID = BitConverter.ToUInt16(state, 4); this._barrelID = BitConverter.ToUInt16(state, 6); this._magazineID = BitConverter.ToUInt16(state, 8); if (this.sightModel != null) { UnityEngine.Object.Destroy(this.sightModel.gameObject); this._sightModel = null; } try { this._sightAsset = (ItemSightAsset)Assets.find(EAssetType.ITEM, this.sightID); } catch { this._sightAsset = null; } this.tempSightMaterial = null; if (this.sightAsset != null && this.sightHook != null) { this._sightModel = UnityEngine.Object.Instantiate <GameObject>(this.sightAsset.sight).transform; this.sightModel.name = "Sight"; this.sightModel.transform.parent = this.sightHook; this.sightModel.transform.localPosition = Vector3.zero; this.sightModel.transform.localRotation = Quaternion.identity; this.sightModel.localScale = Vector3.one; if (viewmodel) { Layerer.viewmodel(this.sightModel); } if (this.gunAsset != null && this.skinAsset != null && this.skinAsset.secondarySkins != null) { Material material = null; if (!this.skinAsset.secondarySkins.TryGetValue(this.sightID, out material) && this.skinAsset.hasSight && this.sightAsset.isPaintable) { if (this.sightAsset.albedoBase != null && this.skinAsset.attachmentSkin != null) { material = UnityEngine.Object.Instantiate <Material>(this.skinAsset.attachmentSkin); material.SetTexture("_AlbedoBase", this.sightAsset.albedoBase); material.SetTexture("_MetallicBase", this.sightAsset.metallicBase); material.SetTexture("_EmissionBase", this.sightAsset.emissionBase); } else if (this.skinAsset.tertiarySkin != null) { material = this.skinAsset.tertiarySkin; } } if (material != null) { HighlighterTool.rematerialize(this.sightModel, material, out this.tempSightMaterial); } } } if (this.tacticalModel != null) { UnityEngine.Object.Destroy(this.tacticalModel.gameObject); this._tacticalModel = null; } try { this._tacticalAsset = (ItemTacticalAsset)Assets.find(EAssetType.ITEM, this.tacticalID); } catch { this._tacticalAsset = null; } this.tempTacticalMaterial = null; if (this.tacticalAsset != null && this.tacticalHook != null) { this._tacticalModel = UnityEngine.Object.Instantiate <GameObject>(this.tacticalAsset.tactical).transform; this.tacticalModel.name = "Tactical"; this.tacticalModel.transform.parent = this.tacticalHook; this.tacticalModel.transform.localPosition = Vector3.zero; this.tacticalModel.transform.localRotation = Quaternion.identity; this.tacticalModel.localScale = Vector3.one; if (viewmodel) { Layerer.viewmodel(this.tacticalModel); } if (this.gunAsset != null && this.skinAsset != null && this.skinAsset.secondarySkins != null) { Material material2 = null; if (!this.skinAsset.secondarySkins.TryGetValue(this.tacticalID, out material2) && this.skinAsset.hasTactical && this.tacticalAsset.isPaintable) { if (this.tacticalAsset.albedoBase != null && this.skinAsset.attachmentSkin != null) { material2 = UnityEngine.Object.Instantiate <Material>(this.skinAsset.attachmentSkin); material2.SetTexture("_AlbedoBase", this.tacticalAsset.albedoBase); material2.SetTexture("_MetallicBase", this.tacticalAsset.metallicBase); material2.SetTexture("_EmissionBase", this.tacticalAsset.emissionBase); } else if (this.skinAsset.tertiarySkin != null) { material2 = this.skinAsset.tertiarySkin; } } if (material2 != null) { HighlighterTool.rematerialize(this.tacticalModel, material2, out this.tempTacticalMaterial); } } } if (this.gripModel != null) { UnityEngine.Object.Destroy(this.gripModel.gameObject); this._gripModel = null; } try { this._gripAsset = (ItemGripAsset)Assets.find(EAssetType.ITEM, this.gripID); } catch { this._gripAsset = null; } this.tempGripMaterial = null; if (this.gripAsset != null && this.gripHook != null) { this._gripModel = UnityEngine.Object.Instantiate <GameObject>(this.gripAsset.grip).transform; this.gripModel.name = "Grip"; this.gripModel.transform.parent = this.gripHook; this.gripModel.transform.localPosition = Vector3.zero; this.gripModel.transform.localRotation = Quaternion.identity; this.gripModel.localScale = Vector3.one; if (viewmodel) { Layerer.viewmodel(this.gripModel); } if (this.gunAsset != null && this.skinAsset != null && this.skinAsset.secondarySkins != null) { Material material3 = null; if (!this.skinAsset.secondarySkins.TryGetValue(this.gripID, out material3) && this.skinAsset.hasGrip && this.gripAsset.isPaintable) { if (this.gripAsset.albedoBase != null && this.skinAsset.attachmentSkin != null) { material3 = UnityEngine.Object.Instantiate <Material>(this.skinAsset.attachmentSkin); material3.SetTexture("_AlbedoBase", this.gripAsset.albedoBase); material3.SetTexture("_MetallicBase", this.gripAsset.metallicBase); material3.SetTexture("_EmissionBase", this.gripAsset.emissionBase); } else if (this.skinAsset.tertiarySkin != null) { material3 = this.skinAsset.tertiarySkin; } } if (material3 != null) { HighlighterTool.rematerialize(this.gripModel, material3, out this.tempGripMaterial); } } } if (this.barrelModel != null) { UnityEngine.Object.Destroy(this.barrelModel.gameObject); this._barrelModel = null; } try { this._barrelAsset = (ItemBarrelAsset)Assets.find(EAssetType.ITEM, this.barrelID); } catch { this._barrelAsset = null; } this.tempBarrelMaterial = null; if (this.barrelAsset != null && this.barrelHook != null) { this._barrelModel = UnityEngine.Object.Instantiate <GameObject>(this.barrelAsset.barrel).transform; this.barrelModel.name = "Barrel"; this.barrelModel.transform.parent = this.barrelHook; this.barrelModel.transform.localPosition = Vector3.zero; this.barrelModel.transform.localRotation = Quaternion.identity; this.barrelModel.localScale = Vector3.one; if (viewmodel) { Layerer.viewmodel(this.barrelModel); } if (this.gunAsset != null && this.skinAsset != null && this.skinAsset.secondarySkins != null) { Material material4 = null; if (!this.skinAsset.secondarySkins.TryGetValue(this.barrelID, out material4) && this.skinAsset.hasBarrel && this.barrelAsset.isPaintable) { if (this.barrelAsset.albedoBase != null && this.skinAsset.attachmentSkin != null) { material4 = UnityEngine.Object.Instantiate <Material>(this.skinAsset.attachmentSkin); material4.SetTexture("_AlbedoBase", this.barrelAsset.albedoBase); material4.SetTexture("_MetallicBase", this.barrelAsset.metallicBase); material4.SetTexture("_EmissionBase", this.barrelAsset.emissionBase); } else if (this.skinAsset.tertiarySkin != null) { material4 = this.skinAsset.tertiarySkin; } } if (material4 != null) { HighlighterTool.rematerialize(this.barrelModel, material4, out this.tempBarrelMaterial); } } } if (this.magazineModel != null) { UnityEngine.Object.Destroy(this.magazineModel.gameObject); this._magazineModel = null; } try { this._magazineAsset = (ItemMagazineAsset)Assets.find(EAssetType.ITEM, this.magazineID); } catch { this._magazineAsset = null; } this.tempMagazineMaterial = null; if (this.magazineAsset != null && this.magazineHook != null) { Transform transform = null; if (this.magazineAsset.calibers.Length > 0) { transform = this.magazineHook.FindChild("Caliber_" + this.magazineAsset.calibers[0]); } if (transform == null) { transform = this.magazineHook; } this._magazineModel = UnityEngine.Object.Instantiate <GameObject>(this.magazineAsset.magazine).transform; this.magazineModel.name = "Magazine"; this.magazineModel.transform.parent = transform; this.magazineModel.transform.localPosition = Vector3.zero; this.magazineModel.transform.localRotation = Quaternion.identity; this.magazineModel.localScale = Vector3.one; if (viewmodel) { Layerer.viewmodel(this.magazineModel); } if (this.gunAsset != null && this.skinAsset != null && this.skinAsset.secondarySkins != null) { Material material5 = null; if (!this.skinAsset.secondarySkins.TryGetValue(this.magazineID, out material5) && this.skinAsset.hasMagazine && this.magazineAsset.isPaintable) { if (this.magazineAsset.albedoBase != null && this.skinAsset.attachmentSkin != null) { material5 = UnityEngine.Object.Instantiate <Material>(this.skinAsset.attachmentSkin); material5.SetTexture("_AlbedoBase", this.magazineAsset.albedoBase); material5.SetTexture("_MetallicBase", this.magazineAsset.metallicBase); material5.SetTexture("_EmissionBase", this.magazineAsset.emissionBase); } else if (this.skinAsset.tertiarySkin != null) { material5 = this.skinAsset.tertiarySkin; } } if (material5 != null) { HighlighterTool.rematerialize(this.magazineModel, material5, out this.tempMagazineMaterial); } } } if (this.tacticalModel != null && this.tacticalModel.childCount > 0) { this._lightHook = this.tacticalModel.transform.FindChild("Model_0").FindChild("Light"); this._light2Hook = this.tacticalModel.transform.FindChild("Model_0").FindChild("Light2"); if (viewmodel) { if (this.lightHook != null) { this.lightHook.tag = "Viewmodel"; this.lightHook.gameObject.layer = LayerMasks.VIEWMODEL; Transform transform2 = this.lightHook.FindChild("Light"); if (transform2 != null) { transform2.tag = "Viewmodel"; transform2.gameObject.layer = LayerMasks.VIEWMODEL; } } if (this.light2Hook != null) { this.light2Hook.tag = "Viewmodel"; this.light2Hook.gameObject.layer = LayerMasks.VIEWMODEL; Transform transform3 = this.light2Hook.FindChild("Light"); if (transform3 != null) { transform3.tag = "Viewmodel"; transform3.gameObject.layer = LayerMasks.VIEWMODEL; } } } else { LightLODTool.applyLightLOD(this.lightHook); LightLODTool.applyLightLOD(this.light2Hook); } } else { this._lightHook = null; this._light2Hook = null; } if (this.sightModel != null) { this._aimHook = this.sightModel.transform.FindChild("Model_0").FindChild("Aim"); if (this.aimHook != null) { Transform transform4 = this.aimHook.parent.FindChild("Reticule"); if (transform4 != null) { Renderer component = transform4.GetComponent <Renderer>(); Material material6 = component.material; material6.SetColor("_Color", OptionsSettings.criticalHitmarkerColor); material6.SetColor("_EmissionColor", OptionsSettings.criticalHitmarkerColor); } } this._reticuleHook = this.sightModel.transform.FindChild("Model_0").FindChild("Reticule"); } else { this._aimHook = null; this._reticuleHook = null; } if (this.aimHook != null) { this._scopeHook = this.aimHook.FindChild("Scope"); } else { this._scopeHook = null; } if (this.rope != null && viewmodel) { this.rope.tag = "Viewmodel"; this.rope.gameObject.layer = LayerMasks.VIEWMODEL; } this.wasSkinned = true; this.applyVisual(); }