Beispiel #1
0
 // Token: 0x06000679 RID: 1657 RVA: 0x0006BA40 File Offset: 0x00069C40
 public void OnEelHit()
 {
     if (BTDebugCamInputManager.GetConfigHolder().hackConfig != null && BTDebugCamInputManager.GetConfigHolder().hackConfig.eelRoast_infiniteEels)
     {
         SanctuaryManager.pCurPetInstance.UpdateMeter(SanctuaryPetMeterType.HAPPINESS, this._PetHappiness);
         if (this._EelBlastColors != null && this._EelBlastColors.Length != 0 && this._EelBlastEffectObj != null)
         {
             int        num        = UnityEngine.Random.Range(0, this._EelBlastColors.Length);
             GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this._EelBlastEffectObj, this.mEelTransform.position, this._EelBlastEffectObj.transform.rotation);
             gameObject.transform.parent = this._PrtParent.transform;
             ParticleSystem.MainModule main = gameObject.GetComponent <ParticleSystem>().main;
             main.startColor = this._EelBlastColors[num];
             if (this._EelHit3DScore != null)
             {
                 Vector3          position    = SanctuaryManager.pCurPetInstance.GetHeadPosition() + this._HappinessTextDragonOffset;
                 GameObject       gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this._EelHit3DScore.gameObject, position, this._EelHit3DScore.transform.rotation);
                 TargetHit3DScore component   = gameObject2.GetComponent <TargetHit3DScore>();
                 component.mDisplayScore      = (int)this._PetHappiness;
                 component.mDisplayText       = this._PetHappinessText._Text;
                 gameObject2.transform.parent = this._PrtParent.transform;
             }
         }
     }
     else
     {
         if (this.mIsDestroying)
         {
             return;
         }
         this._Active = false;
         this._RenderPath.gameObject.SetActive(false);
         this.mIsDestroying = true;
         SanctuaryManager.pCurPetInstance.UpdateMeter(SanctuaryPetMeterType.HAPPINESS, this._PetHappiness);
         if (this._EelBlastColors != null && this._EelBlastColors.Length != 0 && this._EelBlastEffectObj != null)
         {
             int        num        = UnityEngine.Random.Range(0, this._EelBlastColors.Length);
             GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this._EelBlastEffectObj, this.mEelTransform.position, this._EelBlastEffectObj.transform.rotation);
             gameObject.transform.parent = this._PrtParent.transform;
             ParticleSystem.MainModule main = gameObject.GetComponent <ParticleSystem>().main;
             main.startColor = this._EelBlastColors[num];
             if (this._EelHit3DScore != null)
             {
                 Vector3          position    = SanctuaryManager.pCurPetInstance.GetHeadPosition() + this._HappinessTextDragonOffset;
                 GameObject       gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this._EelHit3DScore.gameObject, position, this._EelHit3DScore.transform.rotation);
                 TargetHit3DScore component   = gameObject2.GetComponent <TargetHit3DScore>();
                 component.mDisplayScore      = (int)this._PetHappiness;
                 component.mDisplayText       = this._PetHappinessText._Text;
                 gameObject2.transform.parent = this._PrtParent.transform;
             }
         }
         if (base.gameObject != null)
         {
             UnityEngine.Object.Destroy(base.gameObject, this._DestroyDelay);
         }
     }
 }
Beispiel #2
0
 // Token: 0x06000683 RID: 1667 RVA: 0x0006BCEC File Offset: 0x00069EEC
 private void SpawnEels()
 {
     if (BTDebugCamInputManager.GetConfigHolder().hackConfig != null && BTDebugCamInputManager.GetConfigHolder().hackConfig.eelRoast_spawnAllEels)
     {
         foreach (EelRoastMarkerInfo markerInfo in this._EelRoastInfos)
         {
             string randomEelPath = this.GetRandomEelPath(markerInfo);
             if (!string.IsNullOrEmpty(randomEelPath))
             {
                 string[] array = randomEelPath.Split(new char[]
                 {
                     '/'
                 });
                 RsResourceManager.LoadAssetFromBundle(array[0] + "/" + array[1], array[2], new RsResourceEventHandler(this.ResourceEventHandler), typeof(GameObject), false, markerInfo);
             }
             else
             {
                 UtDebug.Log("Eel Asset path is empty ");
             }
         }
     }
     else
     {
         if (this._EelRoastInfos == null || this._EelRoastInfos.Length < 1 || this._NoOfEelsToSpawn.Min < 1f || this._NoOfEelsToSpawn.Min > this._NoOfEelsToSpawn.Max)
         {
             return;
         }
         List <EelRoastMarkerInfo> list = new List <EelRoastMarkerInfo>(this._EelRoastInfos);
         int num = Mathf.Clamp(this._NoOfEelsToSpawn.GetRandomInt(), 1, this._EelRoastInfos.Length);
         for (int i = 0; i < num; i++)
         {
             int    index         = UnityEngine.Random.Range(0, list.Count);
             string randomEelPath = this.GetRandomEelPath(list[index]);
             if (!string.IsNullOrEmpty(randomEelPath))
             {
                 string[] array = randomEelPath.Split(new char[]
                 {
                     '/'
                 });
                 RsResourceManager.LoadAssetFromBundle(array[0] + "/" + array[1], array[2], new RsResourceEventHandler(this.ResourceEventHandler), typeof(GameObject), false, list[index]);
             }
             else
             {
                 UtDebug.Log("Eel Asset path is empty ");
             }
             list.RemoveAt(index);
         }
     }
 }