Beispiel #1
0
    public void metactivate()
    {
        clsragdollimbifier componentInChildren = base.GetComponentInChildren <clsragdollimbifier>();

        if (componentInChildren != null)
        {
            componentInChildren.enabled = true;
        }
    }
Beispiel #2
0
    private void OnCollisionEnter(Collision varpsource)
    {
        int vargamcasemanager = this.vargamurgentsource.vargamcasemanager;

        switch (vargamcasemanager + 3)
        {
        case 0:
            if (this.vargamactuatorenabled && varpsource.gameObject.CompareTag("missile") && this.vargamparttype != clsurgutils.enumparttypes.spine)
            {
                this.vargamactuatorenabled = false;
                base.transform.parent      = this.vargamurgentsource.transform;
                clsurgutils.metdrivebodypart(this.vargamurgentsource, this.vargamparttype, 0);
                clsragdollimbifier componentInChildren = base.transform.root.GetComponentInChildren <clsragdollimbifier>();
                if (componentInChildren != null)
                {
                    switch (this.vargamparttype)
                    {
                    case clsurgutils.enumparttypes.arm_left:
                        componentInChildren.varla = true;
                        break;

                    case clsurgutils.enumparttypes.arm_right:
                    {
                        componentInChildren.varra = true;
                        clsdrop componentInChildren2 = base.transform.root.GetComponentInChildren <clsdrop>();
                        if (componentInChildren2 != null)
                        {
                            componentInChildren2.metdrop(varpsource.impactForceSum, true);
                        }
                        break;
                    }

                    case clsurgutils.enumparttypes.leg_left:
                        componentInChildren.varll = true;
                        break;

                    case clsurgutils.enumparttypes.leg_right:
                        componentInChildren.varrl = true;
                        break;
                    }
                }
                else
                {
                    Debug.LogError("No ragdollimbifier found. Part repair compromised.");
                }
                base.GetComponent <Rigidbody>().AddForceAtPosition(varpsource.impactForceSum, varpsource.contacts[0].point, ForceMode.VelocityChange);
            }
            break;

        case 1:
        {
            if (!this.vargamactuatorenabled || (!varpsource.gameObject.CompareTag("missile") && !varpsource.gameObject.CompareTag("terrain")))
            {
                return;
            }
            clsdismemberator componentInChildren3 = this.vargamurgentsource.GetComponentInChildren <clsdismemberator>();
            if (componentInChildren3 != null)
            {
                float num = UnityEngine.Random.Range(0f, 0.99f);
                if (num > 0.75f)
                {
                    clsurgutils.metdismember(base.transform, componentInChildren3.vargamstumpmaterial, componentInChildren3, componentInChildren3.vargamparticleparent, componentInChildren3.vargamparticlechild, true, true);
                }
            }
            else
            {
                Debug.LogError("No Dismemberator Class in source D host.");
            }
            break;
        }

        case 2:
        {
            if (this.vargamactuatorenabled && varpsource.gameObject.CompareTag("missile"))
            {
                this.vargamactuatorenabled = false;
                clsurgutils.metdriveurgent(this.vargamurgentsource, null);
                base.GetComponent <Rigidbody>().AddForceAtPosition(varpsource.impactForceSum, varpsource.contacts[0].point, ForceMode.VelocityChange);
            }
            clsdrop componentInChildren2 = base.transform.root.GetComponentInChildren <clsdrop>();
            if (componentInChildren2 != null)
            {
                componentInChildren2.metdrop(varpsource.impactForceSum, true);
            }
            break;
        }
        }
    }