private void DoShakeMinions()
    {
        GameObject ownerDefaultTarget = base.Fsm.GetOwnerDefaultTarget(this.gameObject);

        if (ownerDefaultTarget == null)
        {
            base.Finish();
        }
        else if (this.MinionsToShake == MinionsToShakeEnum.All)
        {
            MinionShake.ShakeAllMinions(ownerDefaultTarget, this.shakeType, ownerDefaultTarget.transform.position, this.shakeSize, this.customShakeIntensity.Value, this.radius.Value, 0f);
        }
        else if (this.MinionsToShake == MinionsToShakeEnum.Target)
        {
            MinionShake.ShakeTargetMinion(ownerDefaultTarget, this.shakeType, ownerDefaultTarget.transform.position, this.shakeSize, this.customShakeIntensity.Value, 0f, 0f);
        }
        else if (this.MinionsToShake == MinionsToShakeEnum.SelectedGameObject)
        {
            MinionShake.ShakeObject(ownerDefaultTarget, this.shakeType, ownerDefaultTarget.transform.position, this.shakeSize, this.customShakeIntensity.Value, 0f, 0f);
        }
    }
Beispiel #2
0
 private void StartAnimation()
 {
     if (this.m_SuperSpell != null)
     {
         int num = 0;
         foreach (GameObject obj2 in this.m_SuperSpell.GetTargets())
         {
             Vector3    position = obj2.transform.position;
             Quaternion rotation = obj2.transform.rotation;
             num++;
             float      num2 = UnityEngine.Random.Range(this.m_StartDelayMin, this.m_StartDelayMax);
             GameObject item = (GameObject)UnityEngine.Object.Instantiate(this.m_StartImpact, position, rotation);
             this.m_ImpactObjects.Add(item);
             foreach (ParticleSystem system in item.GetComponentsInChildren <ParticleSystem>())
             {
                 system.startDelay = num2;
                 system.Play();
             }
             num2 += 0.2f;
             float     num4      = UnityEngine.Random.Range(this.m_LiftHeightMin, this.m_LiftHeightMax);
             object[]  args      = new object[] { "time", this.m_LiftTime, "delay", num2, "position", new Vector3(position.x, position.y + num4, position.z), "easetype", iTween.EaseType.easeOutQuad, "name", string.Format("Lift_{0}_{1}", obj2.name, num) };
             Hashtable hashtable = iTween.Hash(args);
             iTween.MoveTo(obj2, hashtable);
             Vector3 eulerAngles = rotation.eulerAngles;
             eulerAngles.x += UnityEngine.Random.Range(this.m_LiftRotMin, this.m_LiftRotMax);
             eulerAngles.z += UnityEngine.Random.Range(this.m_LiftRotMin, this.m_LiftRotMax);
             object[]  objArray2  = new object[] { "time", (this.m_LiftTime + this.m_HoverTime) + (this.m_SlamTime * 0.8f), "delay", num2, "rotation", eulerAngles, "easetype", iTween.EaseType.easeOutQuad, "name", string.Format("LiftRot_{0}_{1}", obj2.name, num) };
             Hashtable hashtable2 = iTween.Hash(objArray2);
             iTween.RotateTo(obj2, hashtable2);
             float     num5       = this.m_StartDelayMax + this.m_LiftTime;
             float     num6       = num5 + this.m_HoverTime;
             object[]  objArray3  = new object[] { "time", this.m_SlamTime, "delay", num6, "position", position, "easetype", iTween.EaseType.easeInCubic, "name", string.Format("SlamPos_{0}_{1}", obj2.name, num) };
             Hashtable hashtable3 = iTween.Hash(objArray3);
             iTween.MoveTo(obj2, hashtable3);
             object[]  objArray4  = new object[] { "time", this.m_SlamTime * 0.8f, "delay", num6 + (this.m_SlamTime * 0.2f), "rotation", Vector3.zero, "easetype", iTween.EaseType.easeInQuad, "oncomplete", "Finished", "oncompletetarget", base.gameObject, "name", string.Format("SlamRot_{0}_{1}", obj2.name, num) };
             Hashtable hashtable4 = iTween.Hash(objArray4);
             iTween.RotateTo(obj2, hashtable4);
             this.m_TotalTime = num6 + this.m_SlamTime;
             if (obj2.GetComponentInChildren <MinionShake>() != null)
             {
                 MinionShake.ShakeObject(obj2, ShakeMinionType.RandomDirection, obj2.transform.position, ShakeMinionIntensity.LargeShake, 1f, 0.1f, num6 + this.m_SlamTime, true, true);
             }
             else
             {
                 Bounce component = obj2.GetComponent <Bounce>();
                 if (component == null)
                 {
                     component = obj2.AddComponent <Bounce>();
                 }
                 component.m_BounceAmount = num4 * this.m_Bounceness;
                 component.m_BounceSpeed  = 3.5f * UnityEngine.Random.Range((float)0.8f, (float)1.3f);
                 component.m_BounceCount  = 3;
                 component.m_Bounceness   = this.m_Bounceness;
                 component.m_Delay        = num6 + this.m_SlamTime;
                 component.StartAnimation();
             }
             GameObject obj4 = (GameObject)UnityEngine.Object.Instantiate(this.m_EndImpact, position, rotation);
             this.m_ImpactObjects.Add(obj4);
             foreach (ParticleSystem system2 in obj4.GetComponentsInChildren <ParticleSystem>())
             {
                 system2.startDelay = num6 + this.m_SlamTime;
                 system2.Play();
             }
         }
     }
 }