806 lines
24 KiB
C#
806 lines
24 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using AmplitudeMiniJSON;
|
|
using Photon;
|
|
using RecNet;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
// Token: 0x02000F36 RID: 3894
|
|
public class GiftBox : global::Photon.MonoBehaviour
|
|
{
|
|
// Token: 0x17000EFE RID: 3838
|
|
// (get) Token: 0x0602054B RID: 132427 RVA: 0x008C81E8 File Offset: 0x008C63E8
|
|
// (set) Token: 0x0602054C RID: 132428 RVA: 0x008C81F8 File Offset: 0x008C63F8
|
|
public GiftBox.INMNEEDHGFD BKEIGACNCJP
|
|
{
|
|
get
|
|
{
|
|
return this.GGAOBNBFJNH.CPIBGJLHLBL();
|
|
}
|
|
protected set
|
|
{
|
|
this.GGAOBNBFJNH.MEAINJPIECA(value);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0602054D RID: 132429 RVA: 0x008C8208 File Offset: 0x008C6408
|
|
protected override void OnDestroy()
|
|
{
|
|
if (this.OnGiftBoxDestroyed != null)
|
|
{
|
|
this.OnGiftBoxDestroyed(this);
|
|
}
|
|
if (this.GBJAAMHKPMA != null)
|
|
{
|
|
this.GBJAAMHKPMA.MPOJPIKJFAK -= this.NOIOHFHKIPM;
|
|
}
|
|
if (this.OIOHMCMLDEJ != null && this.OIOHMCMLDEJ.LNJFOAHGEEA)
|
|
{
|
|
this.OIOHMCMLDEJ.LBMHLHMMPKK -= this.PGBPNPCBKBI;
|
|
if (!this.OIOHMCMLDEJ.BKDFLNGCINH.OHGPCMJMFGC)
|
|
{
|
|
IHFKMIAHBFP.JFCIOOHPLFJ(this.OIOHMCMLDEJ.OMNGGJICBBI);
|
|
}
|
|
}
|
|
base.OnDestroy();
|
|
}
|
|
|
|
// Token: 0x0602054E RID: 132430 RVA: 0x008C82B8 File Offset: 0x008C64B8
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
this.GGAOBNBFJNH = new LHLLJPPCDKA<GiftBox.INMNEEDHGFD>(this, "GS", this.AKPOBGIEOGF, IKCAJLLAFML.AUTHORITY, new Action(this.IBOPHPCJNPA));
|
|
this.CKCKBMAJDCM = new LHLLJPPCDKA<GiftBox.IKCOJMDCDFG>(this, "GC", GiftBox.IKCOJMDCDFG.Unspecified, IKCAJLLAFML.AUTHORITY, null);
|
|
this.LEJJEHILLOA = new LHLLJPPCDKA<int>(this, "GCV", -1, IKCAJLLAFML.AUTHORITY, null);
|
|
Dictionary<string, object> dictionary = base.OMNGGJICBBI.NFOKNEKLACK[1] as Dictionary<string, object>;
|
|
int num = (int)dictionary["Owner"];
|
|
this.HKPILPPHGDE = LNJFBGIBLHA.FDOBBLFBBBK(num);
|
|
string text = (string)dictionary["GiftJSON"];
|
|
try
|
|
{
|
|
Dictionary<string, object> dictionary2 = HOEKEPDDBBF.DKMOHDIJHAE(text) as Dictionary<string, object>;
|
|
this.MJFPCJJOKMJ = OFPFHHLNHIC.DKMOHDIJHAE<IOIGNLEIABB.PGMLKNLPFJM>(dictionary2);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Debug.LogException(ex);
|
|
this.MJFPCJJOKMJ = null;
|
|
}
|
|
GiftManager.GCOCKIEJCGH gcockiejcgh = ((this.MJFPCJJOKMJ == null) ? GiftManager.GCOCKIEJCGH.Common : this.MJFPCJJOKMJ.GCOCKIEJCGH);
|
|
foreach (RarityController rarityController in base.GetComponentsInChildren<RarityController>(true))
|
|
{
|
|
rarityController.SetRarity(gcockiejcgh);
|
|
}
|
|
this.GFPKPLNEBKL(this.MJFPCJJOKMJ);
|
|
this.PJPCNNKEIOP(this.MJFPCJJOKMJ);
|
|
if (this.MJFPCJJOKMJ != null && this.JPJBIKGBFPM)
|
|
{
|
|
OutfitSelection outfitSelection = OutfitSelection.GPKJJKCHILI(this.MJFPCJJOKMJ.PLCNNDBKAHE);
|
|
if (OutfitSelection.NOGAGKDDFDB(outfitSelection, null))
|
|
{
|
|
Outfit outfit = NetworkedSingletonMonoBehaviour<OutfitManager>.NCKMBFBMBFM.LocalSpawnOutfitTool(outfitSelection, PlayerSpawnedEquipment.EJADIIIMOPI.GiftBox);
|
|
Tool tool = outfit.BKDFLNGCINH;
|
|
this.OIOHMCMLDEJ = tool.GEONLHPMMPG;
|
|
tool.transform.position = GiftBox.PEAAAJMHFJB;
|
|
this.NEOMJEOOCNH = GiftBox.IKCOJMDCDFG.AvatarItem;
|
|
}
|
|
else if (!string.IsNullOrEmpty(this.MJFPCJJOKMJ.NEKNEGFNIHN))
|
|
{
|
|
Dictionary<string, object> dictionary3 = new Dictionary<string, object>
|
|
{
|
|
{
|
|
"Owner",
|
|
IHFKMIAHBFP.JEFGMHBLLKI.BADMPMDONAH
|
|
},
|
|
{ "Purpose", 3 },
|
|
{
|
|
"ModificationGuid",
|
|
this.MJFPCJJOKMJ.CICOGPIOGKD
|
|
}
|
|
};
|
|
Tool tool2 = Tool.PhotonInstantiate(this.MJFPCJJOKMJ.NEKNEGFNIHN, GiftBox.PEAAAJMHFJB, Quaternion.identity, base.OMNGGJICBBI.ADMBCINHJOG, dictionary3);
|
|
this.OIOHMCMLDEJ = tool2.GEONLHPMMPG;
|
|
this.NEOMJEOOCNH = GiftBox.IKCOJMDCDFG.EquipmentItem;
|
|
}
|
|
else
|
|
{
|
|
this.NEOMJEOOCNH = GiftBox.IKCOJMDCDFG.XP;
|
|
}
|
|
if (this.OIOHMCMLDEJ != null)
|
|
{
|
|
this.OIOHMCMLDEJ.BKDFLNGCINH.NIINOABKAPJ = false;
|
|
foreach (Rigidbody rigidbody in this.OIOHMCMLDEJ.GetComponentsInChildren<Rigidbody>())
|
|
{
|
|
GiftBox.JOGIJIDOMLC jogijidomlc = default(GiftBox.JOGIJIDOMLC);
|
|
jogijidomlc.BOKCGGNGBOK = rigidbody;
|
|
jogijidomlc.LLMDMMALKLO = rigidbody.transform.localPosition;
|
|
jogijidomlc.ODDNOMMJFII = rigidbody.transform.localRotation;
|
|
this.BOADELGJDKF.Add(jogijidomlc);
|
|
}
|
|
}
|
|
}
|
|
this.GBJAAMHKPMA = base.GetComponentInChildren<TearStripTab>();
|
|
if (this.GBJAAMHKPMA != null)
|
|
{
|
|
this.GBJAAMHKPMA.MPOJPIKJFAK += this.NOIOHFHKIPM;
|
|
}
|
|
this.BKEIGACNCJP = this.AKPOBGIEOGF;
|
|
if (this.xpText != null)
|
|
{
|
|
this.xpText.text = string.Empty;
|
|
}
|
|
if (this.nameTagText != null)
|
|
{
|
|
this.nameTagText.text = this.HKPILPPHGDE.KODHOHBEAOP.HDDFDDFHEHB(16, "...");
|
|
}
|
|
}
|
|
|
|
// Token: 0x0602054F RID: 132431 RVA: 0x008C8650 File Offset: 0x008C6850
|
|
public int ILEMMPACGFN()
|
|
{
|
|
return this.LEJJEHILLOA.CPIBGJLHLBL();
|
|
}
|
|
|
|
// Token: 0x17000F00 RID: 3840
|
|
// (get) Token: 0x0602056F RID: 132463 RVA: 0x008C9414 File Offset: 0x008C7614
|
|
// (set) Token: 0x06020550 RID: 132432 RVA: 0x008C8660 File Offset: 0x008C6860
|
|
public int AFDOJKECMGG
|
|
{
|
|
get
|
|
{
|
|
return this.LEJJEHILLOA.CPIBGJLHLBL();
|
|
}
|
|
private set
|
|
{
|
|
this.LEJJEHILLOA.MEAINJPIECA(value);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06020551 RID: 132433 RVA: 0x008C8670 File Offset: 0x008C6870
|
|
private void GFPKPLNEBKL(IOIGNLEIABB.PGMLKNLPFJM MJFPCJJOKMJ)
|
|
{
|
|
if (MJFPCJJOKMJ != null)
|
|
{
|
|
Material material;
|
|
if (MJFPCJJOKMJ.OEPABIHCFLG != null)
|
|
{
|
|
material = MJFPCJJOKMJ.OEPABIHCFLG;
|
|
}
|
|
else
|
|
{
|
|
material = SingletonMonoBehaviour<GiftManager>.NCKMBFBMBFM.AIAOFENJIBO;
|
|
}
|
|
foreach (Renderer renderer in this.variantMaterialRenderers)
|
|
{
|
|
renderer.material = material;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06020552 RID: 132434 RVA: 0x008C86D4 File Offset: 0x008C68D4
|
|
public bool MGJOJDEGEBA()
|
|
{
|
|
return this.HKPILPPHGDE == null || this.HKPILPPHGDE.IPFPJCPGENH;
|
|
}
|
|
|
|
// Token: 0x06020553 RID: 132435 RVA: 0x008C86F0 File Offset: 0x008C68F0
|
|
private void NOIOHFHKIPM(TearStripTab GBJAAMHKPMA)
|
|
{
|
|
this.BKEIGACNCJP = GiftBox.INMNEEDHGFD.Opening;
|
|
if (GBJAAMHKPMA != null)
|
|
{
|
|
GBJAAMHKPMA.MPOJPIKJFAK -= this.NOIOHFHKIPM;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000EFB RID: 3835
|
|
// (get) Token: 0x06020554 RID: 132436 RVA: 0x008C8718 File Offset: 0x008C6918
|
|
// (set) Token: 0x0602055E RID: 132446 RVA: 0x008C8A78 File Offset: 0x008C6C78
|
|
public Vector3 CIFHNCGLFKB { get; set; }
|
|
|
|
// Token: 0x17000EFD RID: 3837
|
|
// (get) Token: 0x06020555 RID: 132437 RVA: 0x008C8720 File Offset: 0x008C6920
|
|
public bool JPJBIKGBFPM
|
|
{
|
|
get
|
|
{
|
|
return this.HKPILPPHGDE != null && this.HKPILPPHGDE.IPFPJCPGENH;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06020556 RID: 132438 RVA: 0x008C873C File Offset: 0x008C693C
|
|
private void PGKDILNGCEO(int NOBAPCOKFIL)
|
|
{
|
|
this.LEJJEHILLOA.MEAINJPIECA(NOBAPCOKFIL);
|
|
}
|
|
|
|
// Token: 0x06020557 RID: 132439 RVA: 0x008C874C File Offset: 0x008C694C
|
|
private void AFNODKHOCDC(TearStripTab GBJAAMHKPMA)
|
|
{
|
|
this.BKEIGACNCJP = GiftBox.INMNEEDHGFD.Closed;
|
|
if (GBJAAMHKPMA != null)
|
|
{
|
|
GBJAAMHKPMA.JLBOKENFJGN(new Action<TearStripTab>(this.AFNODKHOCDC));
|
|
}
|
|
}
|
|
|
|
// Token: 0x06020558 RID: 132440 RVA: 0x008C8774 File Offset: 0x008C6974
|
|
protected virtual void GMBFJHIHJFB()
|
|
{
|
|
if (this.boxOpenAudio != null)
|
|
{
|
|
AudioManager.Play3DSFX(this.boxAppearAudio, base.transform, null);
|
|
}
|
|
if (this.BKEIGACNCJP != this.AKPOBGIEOGF)
|
|
{
|
|
this.IBOPHPCJNPA();
|
|
if (this.BKEIGACNCJP == this.BKEIGACNCJP)
|
|
{
|
|
this.GBJAAMHKPMA.FGMLLOCEHDL();
|
|
}
|
|
if (this.nameTagText != null)
|
|
{
|
|
this.nameTagText.enabled = false;
|
|
}
|
|
}
|
|
if (this.JPJBIKGBFPM && this.OIOHMCMLDEJ != null)
|
|
{
|
|
this.PGKDILNGCEO(this.OIOHMCMLDEJ.CJKKPMHAMCN().NBAIABPNLNK());
|
|
}
|
|
}
|
|
|
|
// Token: 0x06020559 RID: 132441 RVA: 0x008C8824 File Offset: 0x008C6A24
|
|
private void DKNCDPOBDKN(IOIGNLEIABB.PGMLKNLPFJM MJFPCJJOKMJ)
|
|
{
|
|
if (MJFPCJJOKMJ != null)
|
|
{
|
|
Material material;
|
|
if (MJFPCJJOKMJ.OEPABIHCFLG != null)
|
|
{
|
|
material = MJFPCJJOKMJ.OEPABIHCFLG;
|
|
}
|
|
else
|
|
{
|
|
material = SingletonMonoBehaviour<GiftManager>.NCKMBFBMBFM.GGAPMDOMCLO();
|
|
}
|
|
Renderer[] array = this.variantMaterialRenderers;
|
|
for (int i = 1; i < array.Length; i += 0)
|
|
{
|
|
Renderer renderer = array[i];
|
|
renderer.material = material;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x0602055A RID: 132442 RVA: 0x008C8888 File Offset: 0x008C6A88
|
|
private void BOJIIPPANNP(IOIGNLEIABB.PGMLKNLPFJM MJFPCJJOKMJ)
|
|
{
|
|
if (this.labelText != null)
|
|
{
|
|
if (MJFPCJJOKMJ != null && !string.IsNullOrEmpty(MJFPCJJOKMJ.IMGPDLHMJEE))
|
|
{
|
|
this.labelText.text = MJFPCJJOKMJ.NLLPPLIKMIK();
|
|
}
|
|
else
|
|
{
|
|
this.labelText.canvas.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x0602055B RID: 132443 RVA: 0x008C88E8 File Offset: 0x008C6AE8
|
|
private void Update()
|
|
{
|
|
if (this.BKEIGACNCJP == GiftBox.INMNEEDHGFD.Open && this.toolAnchorAnimator.enabled)
|
|
{
|
|
foreach (GiftBox.JOGIJIDOMLC jogijidomlc in this.BOADELGJDKF)
|
|
{
|
|
if (jogijidomlc.BOKCGGNGBOK != null)
|
|
{
|
|
jogijidomlc.BOKCGGNGBOK.transform.localPosition = jogijidomlc.LLMDMMALKLO;
|
|
jogijidomlc.BOKCGGNGBOK.transform.localRotation = jogijidomlc.ODDNOMMJFII;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x0602055D RID: 132445 RVA: 0x008C89C8 File Offset: 0x008C6BC8
|
|
protected virtual void KFMEHMEDGBE()
|
|
{
|
|
if (this.boxOpenAudio != null)
|
|
{
|
|
AudioManager.Play3DSFX(this.boxAppearAudio, base.transform, null);
|
|
}
|
|
if (this.BKEIGACNCJP != this.AKPOBGIEOGF)
|
|
{
|
|
this.IBOPHPCJNPA();
|
|
if (this.BKEIGACNCJP == this.BKEIGACNCJP)
|
|
{
|
|
this.GBJAAMHKPMA.FGMLLOCEHDL();
|
|
}
|
|
if (this.nameTagText != null)
|
|
{
|
|
this.nameTagText.enabled = true;
|
|
}
|
|
}
|
|
if (this.JPJBIKGBFPM && this.OIOHMCMLDEJ != null)
|
|
{
|
|
this.AFDOJKECMGG = this.OIOHMCMLDEJ.LHEPJEHMAEC().GCPHMBPAAOM();
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000EFF RID: 3839
|
|
// (get) Token: 0x0602055F RID: 132447 RVA: 0x008C8A84 File Offset: 0x008C6C84
|
|
// (set) Token: 0x0602056C RID: 132460 RVA: 0x008C900C File Offset: 0x008C720C
|
|
public GiftBox.IKCOJMDCDFG NEOMJEOOCNH
|
|
{
|
|
get
|
|
{
|
|
return this.CKCKBMAJDCM.CPIBGJLHLBL();
|
|
}
|
|
private set
|
|
{
|
|
this.CKCKBMAJDCM.MEAINJPIECA(value);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06020560 RID: 132448 RVA: 0x008C8A94 File Offset: 0x008C6C94
|
|
private void IBOPHPCJNPA()
|
|
{
|
|
this.boxAnimator.SetInteger("State", (int)this.BKEIGACNCJP);
|
|
switch (this.BKEIGACNCJP)
|
|
{
|
|
case GiftBox.INMNEEDHGFD.Opening:
|
|
if (this.JPJBIKGBFPM)
|
|
{
|
|
base.StartCoroutine(this.AFPPDDGFJNO());
|
|
}
|
|
if (this.nameTagText != null)
|
|
{
|
|
this.nameTagText.enabled = false;
|
|
}
|
|
this.GILAMPHFBDA();
|
|
break;
|
|
case GiftBox.INMNEEDHGFD.Open:
|
|
case GiftBox.INMNEEDHGFD.Failed:
|
|
{
|
|
if (this.BKEIGACNCJP == GiftBox.INMNEEDHGFD.Open)
|
|
{
|
|
this.CGEDKPCIBKG();
|
|
}
|
|
this.toolAnchorAnimator.SetTrigger("Spawn");
|
|
Tool tool = Tool.Find(this.AFDOJKECMGG);
|
|
if (this.JPJBIKGBFPM && tool != null)
|
|
{
|
|
tool.NIINOABKAPJ = true;
|
|
}
|
|
this.OIOHMCMLDEJ = ((!(tool != null)) ? null : tool.GEONLHPMMPG);
|
|
if (this.OIOHMCMLDEJ != null)
|
|
{
|
|
this.toolContainer.AttachTool(this.OIOHMCMLDEJ.BKDFLNGCINH);
|
|
this.OIOHMCMLDEJ.BKDFLNGCINH.AddCustomPickupCondition(new Tool.CFIAHKNGIKI(this.GAKBNHNAONB));
|
|
if (this.OIOHMCMLDEJ.BKDFLNGCINH.ACAJJPKPKBH != null)
|
|
{
|
|
this.OIOHMCMLDEJ.BKDFLNGCINH.ACAJJPKPKBH.SuppressAnimation = false;
|
|
}
|
|
if (this.OIOHMCMLDEJ.BKDFLNGCINH.NIINOABKAPJ && !base.gameObject.activeSelf)
|
|
{
|
|
base.gameObject.SetActive(true);
|
|
}
|
|
if (this.JPJBIKGBFPM)
|
|
{
|
|
this.OIOHMCMLDEJ.LBMHLHMMPKK += this.PGBPNPCBKBI;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (this.xpText != null && this.MJFPCJJOKMJ != null)
|
|
{
|
|
this.xpText.text = this.MJFPCJJOKMJ.ACKDBJKBJII + " XP";
|
|
this.xpText.canvas.worldCamera = ViveControllerInput.Instance.ControllerCamera;
|
|
}
|
|
if (this.JPJBIKGBFPM)
|
|
{
|
|
base.StartCoroutine(this.LLAKKMIAKIH());
|
|
}
|
|
}
|
|
this.PPNBEABDPNG();
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000F01 RID: 3841
|
|
// (get) Token: 0x06020561 RID: 132449 RVA: 0x008C8CD8 File Offset: 0x008C6ED8
|
|
public bool LGCGNIKHEHA
|
|
{
|
|
get
|
|
{
|
|
return Player.LocalPlayerExists && (Player.LocalPlayer.FGLFIJLGCKD - base.transform.position).magnitude <= this.CloseToPlayerDistance;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06020562 RID: 132450 RVA: 0x008C8D20 File Offset: 0x008C6F20
|
|
private void PGBPNPCBKBI(PlayerSpawnedEquipment OIOHMCMLDEJ)
|
|
{
|
|
if (this.JPJBIKGBFPM && this.OIOHMCMLDEJ != null)
|
|
{
|
|
this.toolAnchorAnimator.enabled = false;
|
|
base.StartCoroutine(this.LLAKKMIAKIH());
|
|
}
|
|
}
|
|
|
|
// Token: 0x06020563 RID: 132451 RVA: 0x008C8D58 File Offset: 0x008C6F58
|
|
private void PPNBEABDPNG()
|
|
{
|
|
PooledParticle pooledParticle = null;
|
|
if ((this.NEOMJEOOCNH == GiftBox.IKCOJMDCDFG.AvatarItem || this.NEOMJEOOCNH == GiftBox.IKCOJMDCDFG.EquipmentItem) && this.itemBoxOpenedParticlePrefab != null)
|
|
{
|
|
pooledParticle = ObjectPool.NCKMBFBMBFM.Acquire<PooledParticle>(this.itemBoxOpenedParticlePrefab);
|
|
}
|
|
else if (this.NEOMJEOOCNH == GiftBox.IKCOJMDCDFG.XP)
|
|
{
|
|
pooledParticle = ObjectPool.NCKMBFBMBFM.Acquire<PooledParticle>(this.xpBoxOpenedParticlePrefab);
|
|
}
|
|
if (pooledParticle != null)
|
|
{
|
|
pooledParticle.Play(this.boxOpenedParticleRoot.position, this.boxOpenedParticleRoot.rotation, false);
|
|
}
|
|
if (this.NEOMJEOOCNH != GiftBox.IKCOJMDCDFG.Unspecified)
|
|
{
|
|
RecRoomAudioClip recRoomAudioClip = this.boxOpenAudio[(int)this.NEOMJEOOCNH];
|
|
if (recRoomAudioClip != null)
|
|
{
|
|
AudioManager.Play2DSFX(recRoomAudioClip);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06020564 RID: 132452 RVA: 0x008C8E14 File Offset: 0x008C7014
|
|
private bool GAKBNHNAONB(Tool COMHEONOMBA, Player OAKJPHFELHD, bool AABHBODJBNP)
|
|
{
|
|
return COMHEONOMBA.FICBNMJECCH != null && COMHEONOMBA.FICBNMJECCH == OAKJPHFELHD;
|
|
}
|
|
|
|
// Token: 0x06020565 RID: 132453 RVA: 0x008C8E38 File Offset: 0x008C7038
|
|
protected virtual IEnumerator AFPPDDGFJNO()
|
|
{
|
|
if (this.MJFPCJJOKMJ != null)
|
|
{
|
|
global::UnityEngine.MonoBehaviour instance = SingletonMonoBehaviour<GiftManager>.NCKMBFBMBFM;
|
|
GiftManager instance2 = SingletonMonoBehaviour<GiftManager>.NCKMBFBMBFM;
|
|
IOIGNLEIABB.PGMLKNLPFJM mjfpcjjokmj = this.MJFPCJJOKMJ;
|
|
if (GiftBox.IBNOKJEGJAD.DINNJGHCFHI == null)
|
|
{
|
|
GiftBox.IBNOKJEGJAD.DINNJGHCFHI = new GiftManager.JDACJKHJEDJ(GiftBox.IBNOKJEGJAD.OJKNBNGGBEC);
|
|
}
|
|
instance.StartCoroutine(instance2.RunConsumeGift(mjfpcjjokmj, GiftBox.IBNOKJEGJAD.DINNJGHCFHI));
|
|
this.BKEIGACNCJP = GiftBox.INMNEEDHGFD.Open;
|
|
}
|
|
else
|
|
{
|
|
this.BKEIGACNCJP = GiftBox.INMNEEDHGFD.Failed;
|
|
}
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x06020566 RID: 132454 RVA: 0x008C8E54 File Offset: 0x008C7054
|
|
public Transform MFDIKILDIBC()
|
|
{
|
|
return this.toolAnchor;
|
|
}
|
|
|
|
// Token: 0x17000EFC RID: 3836
|
|
// (get) Token: 0x06020567 RID: 132455 RVA: 0x008C8E5C File Offset: 0x008C705C
|
|
public Transform IIDCMNMEDHJ
|
|
{
|
|
get
|
|
{
|
|
return this.toolAnchor;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06020568 RID: 132456 RVA: 0x008C8E64 File Offset: 0x008C7064
|
|
private void CGEDKPCIBKG()
|
|
{
|
|
bool flag = this.MJFPCJJOKMJ != null && this.MJFPCJJOKMJ.ACKDBJKBJII > 0 && Player.LocalPlayerExists && (this.JPJBIKGBFPM || (Player.LocalPlayer.FGLFIJLGCKD - base.transform.position).magnitude <= this.remotePlayerXpBonusDistance);
|
|
if (flag)
|
|
{
|
|
int num = Mathf.CeilToInt((float)this.MJFPCJJOKMJ.ACKDBJKBJII * ((!this.JPJBIKGBFPM) ? 0.1f : 1f));
|
|
SingletonMonoBehaviour<ProgressionManager>.NCKMBFBMBFM.LocalCompleteObjective(ProgressionManager.MPBMNKHKCEE.Default, num);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0602056A RID: 132458 RVA: 0x008C8F58 File Offset: 0x008C7158
|
|
protected virtual void Start()
|
|
{
|
|
if (this.boxOpenAudio != null)
|
|
{
|
|
AudioManager.Play3DSFX(this.boxAppearAudio, base.transform, null);
|
|
}
|
|
if (this.BKEIGACNCJP != this.AKPOBGIEOGF)
|
|
{
|
|
this.IBOPHPCJNPA();
|
|
if (this.BKEIGACNCJP == this.BKEIGACNCJP)
|
|
{
|
|
this.GBJAAMHKPMA.TearOff();
|
|
}
|
|
if (this.nameTagText != null)
|
|
{
|
|
this.nameTagText.enabled = false;
|
|
}
|
|
}
|
|
if (this.JPJBIKGBFPM && this.OIOHMCMLDEJ != null)
|
|
{
|
|
this.AFDOJKECMGG = this.OIOHMCMLDEJ.OMNGGJICBBI.ADMBCINHJOG;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0602056B RID: 132459 RVA: 0x008C9008 File Offset: 0x008C7208
|
|
protected virtual void GILAMPHFBDA()
|
|
{
|
|
}
|
|
|
|
// Token: 0x0602056D RID: 132461 RVA: 0x008C901C File Offset: 0x008C721C
|
|
protected virtual void OLEBPMMFNIF()
|
|
{
|
|
base.FNNCEMJECLP();
|
|
this.GGAOBNBFJNH = new LHLLJPPCDKA<GiftBox.INMNEEDHGFD>(this, "nux_step_finished", this.AKPOBGIEOGF, IKCAJLLAFML.AUTHORITY, new Action(this.IBOPHPCJNPA));
|
|
this.CKCKBMAJDCM = new LHLLJPPCDKA<GiftBox.IKCOJMDCDFG>(this, "Enables and disables spotlights.", GiftBox.IKCOJMDCDFG.Unspecified, IKCAJLLAFML.AUTHORITY, null);
|
|
this.LEJJEHILLOA = new LHLLJPPCDKA<int>(this, "Charge", -1, IKCAJLLAFML.MASTER, null);
|
|
Dictionary<string, object> dictionary = base.BIPEBCPEPKL().JCOIJFNJLNF()[0] as Dictionary<string, object>;
|
|
int num = (int)dictionary["deviceModel"];
|
|
this.HKPILPPHGDE = LNJFBGIBLHA.AEOAPCJIOKO(num);
|
|
string text = (string)dictionary[" ms"];
|
|
try
|
|
{
|
|
Dictionary<string, object> dictionary2 = HOEKEPDDBBF.DKMOHDIJHAE(text) as Dictionary<string, object>;
|
|
this.MJFPCJJOKMJ = OFPFHHLNHIC.DKMOHDIJHAE<IOIGNLEIABB.PGMLKNLPFJM>(dictionary2);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Debug.LogException(ex);
|
|
this.MJFPCJJOKMJ = null;
|
|
}
|
|
GiftManager.GCOCKIEJCGH gcockiejcgh = ((this.MJFPCJJOKMJ == null) ? ((GiftManager.GCOCKIEJCGH)1) : this.MJFPCJJOKMJ.GCOCKIEJCGH);
|
|
RarityController[] componentsInChildren = base.GetComponentsInChildren<RarityController>(false);
|
|
for (int i = 1; i < componentsInChildren.Length; i++)
|
|
{
|
|
RarityController rarityController = componentsInChildren[i];
|
|
rarityController.SetRarity(gcockiejcgh);
|
|
}
|
|
this.GFPKPLNEBKL(this.MJFPCJJOKMJ);
|
|
this.BOJIIPPANNP(this.MJFPCJJOKMJ);
|
|
if (this.MJFPCJJOKMJ != null && this.JPJBIKGBFPM)
|
|
{
|
|
OutfitSelection outfitSelection = OutfitSelection.AHKDIDCBNCH(this.MJFPCJJOKMJ.EAOCPNIKBHJ());
|
|
if (OutfitSelection.FJPMEGKBNDG(outfitSelection, null))
|
|
{
|
|
Outfit outfit = NetworkedSingletonMonoBehaviour<OutfitManager>.NCKMBFBMBFM.LocalSpawnOutfitTool(outfitSelection, (PlayerSpawnedEquipment.EJADIIIMOPI)6);
|
|
Tool tool = outfit.BKDFLNGCINH;
|
|
this.OIOHMCMLDEJ = tool.GEONLHPMMPG;
|
|
tool.transform.position = GiftBox.PEAAAJMHFJB;
|
|
this.NEOMJEOOCNH = GiftBox.IKCOJMDCDFG.XP;
|
|
}
|
|
else if (!string.IsNullOrEmpty(this.MJFPCJJOKMJ.NCGGBJODEIG()))
|
|
{
|
|
Dictionary<string, object> dictionary3 = new Dictionary<string, object>
|
|
{
|
|
{
|
|
"looktarget",
|
|
IHFKMIAHBFP.JEFGMHBLLKI.BADMPMDONAH
|
|
},
|
|
{ "You may not call InitializeDeflate() after calling InitializeInflate().", 8 },
|
|
{
|
|
". Prefab must have a PhotonView component.",
|
|
this.MJFPCJJOKMJ.GJHHAIGKJMO()
|
|
}
|
|
};
|
|
Tool tool2 = Tool.PhotonInstantiate(this.MJFPCJJOKMJ.NEKNEGFNIHN, GiftBox.PEAAAJMHFJB, Quaternion.identity, base.HOPJELLOPNJ().GCPHMBPAAOM(), dictionary3);
|
|
this.OIOHMCMLDEJ = tool2.GEONLHPMMPG;
|
|
this.NEOMJEOOCNH = (GiftBox.IKCOJMDCDFG)4;
|
|
}
|
|
else
|
|
{
|
|
this.NEOMJEOOCNH = GiftBox.IKCOJMDCDFG.XP;
|
|
}
|
|
if (this.OIOHMCMLDEJ != null)
|
|
{
|
|
this.OIOHMCMLDEJ.BBNHOMJPMGK().NIINOABKAPJ = false;
|
|
Rigidbody[] componentsInChildren2 = this.OIOHMCMLDEJ.GetComponentsInChildren<Rigidbody>();
|
|
for (int j = 0; j < componentsInChildren2.Length; j += 0)
|
|
{
|
|
Rigidbody rigidbody = componentsInChildren2[j];
|
|
GiftBox.JOGIJIDOMLC jogijidomlc = default(GiftBox.JOGIJIDOMLC);
|
|
jogijidomlc.BOKCGGNGBOK = rigidbody;
|
|
jogijidomlc.LLMDMMALKLO = rigidbody.transform.localPosition;
|
|
jogijidomlc.ODDNOMMJFII = rigidbody.transform.localRotation;
|
|
this.BOADELGJDKF.Add(jogijidomlc);
|
|
}
|
|
}
|
|
}
|
|
this.GBJAAMHKPMA = base.GetComponentInChildren<TearStripTab>();
|
|
if (this.GBJAAMHKPMA != null)
|
|
{
|
|
this.GBJAAMHKPMA.CCBFOAOEMFA(new Action<TearStripTab>(this.AFNODKHOCDC));
|
|
}
|
|
this.BKEIGACNCJP = this.AKPOBGIEOGF;
|
|
if (this.xpText != null)
|
|
{
|
|
this.xpText.text = string.Empty;
|
|
}
|
|
if (this.nameTagText != null)
|
|
{
|
|
this.nameTagText.text = this.HKPILPPHGDE.JFCNNPBCMMN().HDDFDDFHEHB(-94, "Cannot deserialize object {0} with no PersistenceView on it or its children. Destroying...");
|
|
}
|
|
}
|
|
|
|
// Token: 0x0602056E RID: 132462 RVA: 0x008C93B4 File Offset: 0x008C75B4
|
|
private void PJPCNNKEIOP(IOIGNLEIABB.PGMLKNLPFJM MJFPCJJOKMJ)
|
|
{
|
|
if (this.labelText != null)
|
|
{
|
|
if (MJFPCJJOKMJ != null && !string.IsNullOrEmpty(MJFPCJJOKMJ.IMGPDLHMJEE))
|
|
{
|
|
this.labelText.text = MJFPCJJOKMJ.IMGPDLHMJEE;
|
|
}
|
|
else
|
|
{
|
|
this.labelText.canvas.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06020570 RID: 132464 RVA: 0x008C9424 File Offset: 0x008C7624
|
|
private IEnumerator LLAKKMIAKIH()
|
|
{
|
|
yield return new WaitForSeconds(this.timeBeforeDerez);
|
|
IHFKMIAHBFP.JFCIOOHPLFJ(base.gameObject);
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x04005446 RID: 21574
|
|
public const float DEFAULT_CLOSE_TO_PLAYER_DISTANCE = 2.2f;
|
|
|
|
// Token: 0x04005447 RID: 21575
|
|
private List<GiftBox.JOGIJIDOMLC> BOADELGJDKF = new List<GiftBox.JOGIJIDOMLC>();
|
|
|
|
// Token: 0x04005449 RID: 21577
|
|
protected static readonly int PEOPDGHIAAD = Animator.StringToHash("Opening");
|
|
|
|
// Token: 0x0400544A RID: 21578
|
|
private static readonly Vector3 PEAAAJMHFJB = new Vector3(0f, 0f, 0f);
|
|
|
|
// Token: 0x0400544B RID: 21579
|
|
[SerializeField]
|
|
private GiftBoxEquipmentContainer toolContainer;
|
|
|
|
// Token: 0x0400544C RID: 21580
|
|
[SerializeField]
|
|
private PooledParticle xpBoxOpenedParticlePrefab;
|
|
|
|
// Token: 0x0400544D RID: 21581
|
|
[SerializeField]
|
|
private PooledParticle itemBoxOpenedParticlePrefab;
|
|
|
|
// Token: 0x0400544E RID: 21582
|
|
[SerializeField]
|
|
private Transform boxOpenedParticleRoot;
|
|
|
|
// Token: 0x0400544F RID: 21583
|
|
[SerializeField]
|
|
private Transform toolAnchor;
|
|
|
|
// Token: 0x04005450 RID: 21584
|
|
[SerializeField]
|
|
private Text xpText;
|
|
|
|
// Token: 0x04005451 RID: 21585
|
|
[SerializeField]
|
|
private Text nameTagText;
|
|
|
|
// Token: 0x04005452 RID: 21586
|
|
[SerializeField]
|
|
private Text labelText;
|
|
|
|
// Token: 0x04005453 RID: 21587
|
|
[SerializeField]
|
|
private float remotePlayerXpBonusDistance = 7f;
|
|
|
|
// Token: 0x04005454 RID: 21588
|
|
[SerializeField]
|
|
protected Animator boxAnimator;
|
|
|
|
// Token: 0x04005455 RID: 21589
|
|
[SerializeField]
|
|
private Animator toolAnchorAnimator;
|
|
|
|
// Token: 0x04005456 RID: 21590
|
|
[SerializeField]
|
|
private float timeBeforeDerez = 2f;
|
|
|
|
// Token: 0x04005457 RID: 21591
|
|
[SerializeField]
|
|
private RecRoomAudioClip boxAppearAudio;
|
|
|
|
// Token: 0x04005458 RID: 21592
|
|
[SerializeField]
|
|
[Tooltip("XP box | Outfit item | Equipment item")]
|
|
private RecRoomAudioClip[] boxOpenAudio = new RecRoomAudioClip[3];
|
|
|
|
// Token: 0x04005459 RID: 21593
|
|
[SerializeField]
|
|
private Renderer[] variantMaterialRenderers;
|
|
|
|
// Token: 0x0400545A RID: 21594
|
|
protected IOIGNLEIABB.PGMLKNLPFJM MJFPCJJOKMJ;
|
|
|
|
// Token: 0x0400545B RID: 21595
|
|
private TearStripTab GBJAAMHKPMA;
|
|
|
|
// Token: 0x0400545C RID: 21596
|
|
protected LNJFBGIBLHA HKPILPPHGDE;
|
|
|
|
// Token: 0x0400545D RID: 21597
|
|
private PlayerSpawnedEquipment OIOHMCMLDEJ;
|
|
|
|
// Token: 0x0400545E RID: 21598
|
|
private LHLLJPPCDKA<GiftBox.INMNEEDHGFD> GGAOBNBFJNH;
|
|
|
|
// Token: 0x0400545F RID: 21599
|
|
private LHLLJPPCDKA<GiftBox.IKCOJMDCDFG> CKCKBMAJDCM;
|
|
|
|
// Token: 0x04005460 RID: 21600
|
|
private LHLLJPPCDKA<int> LEJJEHILLOA;
|
|
|
|
// Token: 0x04005461 RID: 21601
|
|
public float CloseToPlayerDistance = 2.2f;
|
|
|
|
// Token: 0x04005462 RID: 21602
|
|
private GiftBox.INMNEEDHGFD AKPOBGIEOGF;
|
|
|
|
// Token: 0x04005463 RID: 21603
|
|
public Action<GiftBox> OnGiftBoxDestroyed;
|
|
|
|
// Token: 0x02000F37 RID: 3895
|
|
public enum INMNEEDHGFD
|
|
{
|
|
// Token: 0x04005465 RID: 21605
|
|
Closed,
|
|
// Token: 0x04005466 RID: 21606
|
|
Opening,
|
|
// Token: 0x04005467 RID: 21607
|
|
Open,
|
|
// Token: 0x04005468 RID: 21608
|
|
Failed
|
|
}
|
|
|
|
// Token: 0x02000F38 RID: 3896
|
|
public enum IKCOJMDCDFG
|
|
{
|
|
// Token: 0x0400546A RID: 21610
|
|
Unspecified = -1,
|
|
// Token: 0x0400546B RID: 21611
|
|
XP,
|
|
// Token: 0x0400546C RID: 21612
|
|
AvatarItem,
|
|
// Token: 0x0400546D RID: 21613
|
|
EquipmentItem
|
|
}
|
|
|
|
// Token: 0x02000F39 RID: 3897
|
|
private struct JOGIJIDOMLC
|
|
{
|
|
// Token: 0x0400546E RID: 21614
|
|
public Rigidbody BOKCGGNGBOK;
|
|
|
|
// Token: 0x0400546F RID: 21615
|
|
public Vector3 LLMDMMALKLO;
|
|
|
|
// Token: 0x04005470 RID: 21616
|
|
public Quaternion ODDNOMMJFII;
|
|
}
|
|
}
|