Beispiel #1
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.ShakingOffDamage)
     {
         Vector3 hit_dir = new Vector3(UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f));
         hit_dir.Normalize();
         this.m_Player.GiveDamage(null, null, 10f, hit_dir, DamageType.Insects, 0, false);
         return;
     }
     if (id == AnimEventID.ShakingOffEnd)
     {
         this.Stop();
         return;
     }
     if (id == AnimEventID.WaspsFlyAwayLHand)
     {
         InsectsManager.Get().FlyAway(Hand.Left);
         return;
     }
     if (id == AnimEventID.WaspsFlyAwayRHand)
     {
         InsectsManager.Get().FlyAway(Hand.Right);
     }
 }
Beispiel #2
0
 protected override void OnEnable()
 {
     base.OnEnable();
     if (this.m_Player.GetCurrentItem(Hand.Right) != null)
     {
         this.m_Player.GetCurrentItem(Hand.Right).gameObject.SetActive(false);
     }
     if (this.m_Player.GetCurrentItem(Hand.Left) != null)
     {
         this.m_Player.GetCurrentItem(Hand.Left).gameObject.SetActive(false);
     }
     if (this.m_Sensor && this.m_Sensor.m_Type == InsectsSensor.Type.Wasps)
     {
         InsectsManager.Get().Activate(InsectsManager.InsectType.Wasp);
         this.m_Animator.SetBool(this.m_BWaspsParam, true);
         this.m_EndTime = Time.time + 3.663f;
     }
     else
     {
         InsectsManager.Get().Activate(InsectsManager.InsectType.Ant);
         this.m_Animator.SetBool(this.m_BInsectsParam, true);
         this.m_EndTime = Time.time + 2.01663f;
     }
     this.m_StartTime = Time.time;
 }
Beispiel #3
0
 protected override void OnDisable()
 {
     base.OnDisable();
     if (this.m_Player.GetCurrentItem(Hand.Right) != null)
     {
         this.m_Player.GetCurrentItem(Hand.Right).gameObject.SetActive(true);
     }
     if (this.m_Player.GetCurrentItem(Hand.Left) != null)
     {
         this.m_Player.GetCurrentItem(Hand.Left).gameObject.SetActive(true);
     }
     this.m_Animator.SetBool(this.m_BInsectsParam, false);
     this.m_Animator.SetBool(this.m_BWaspsParam, false);
     InsectsManager.Get().FlyAway(Hand.Left);
     InsectsManager.Get().FlyAway(Hand.Right);
     this.m_Sensor    = null;
     this.m_StartTime = float.MaxValue;
     this.m_EndTime   = float.MaxValue;
 }
Beispiel #4
0
    protected override void OnEnable()
    {
        base.OnEnable();
        if (this.m_Player.GetCurrentItem(Hand.Right) != null)
        {
            if (this.m_Player.GetCurrentItem(Hand.Right).m_Info.IsHeavyObject())
            {
                this.m_Player.DropItem(this.m_Player.GetCurrentItem(Hand.Right));
            }
            else
            {
                this.m_Player.GetCurrentItem(Hand.Right).gameObject.SetActive(false);
            }
        }
        if (this.m_Player.GetCurrentItem(Hand.Left) != null)
        {
            this.m_Player.GetCurrentItem(Hand.Left).gameObject.SetActive(false);
        }
        InsectsManager.Get().Activate(InsectsManager.InsectType.Ant);
        bool flag  = PlayerArmorModule.Get().IsArmorActive(Limb.LArm);
        bool flag2 = PlayerArmorModule.Get().IsArmorActive(Limb.RArm);

        if (flag && flag2)
        {
            this.m_Animator.SetBool(this.m_BInsectsLRArmorParam, true);
        }
        else if (flag)
        {
            this.m_Animator.SetBool(this.m_BInsectsLArmorParam, true);
        }
        else if (flag2)
        {
            this.m_Animator.SetBool(this.m_BInsectsRArmorParam, true);
        }
        else
        {
            this.m_Animator.SetBool(this.m_BInsectsNoArmorParam, true);
        }
        this.m_EndTime   = Time.time + 2.01663f;
        this.m_StartTime = Time.time;
    }