Esempio n. 1
0
 private void Start()
 {
     this.m_Transform     = base.transform;
     this.m_Rigidbody     = base.GetComponent <Rigidbody>();
     this.m_Audio         = base.GetComponent <AudioSource>();
     this.m_RestAngleFunc = null;
     this.m_RemoveTime    = Time.time + this.LifeTime;
     this.m_RestTime      = Time.time + this.LifeTime * 0.25f;
     this.m_Rigidbody.maxAngularVelocity            = 100f;
     base.GetComponent <AudioSource>().playOnAwake  = false;
     base.GetComponent <AudioSource>().dopplerLevel = 0f;
 }
Esempio n. 2
0
    protected void DecideRestAngle()
    {
        float num = Mathf.Abs(this.m_Transform.eulerAngles.x - 270f);

        if (num < 55f)
        {
            Ray        ray = new Ray(this.m_Transform.position, Vector3.down);
            RaycastHit raycastHit;
            if (Physics.Raycast(ray, out raycastHit, 1f) && raycastHit.normal == Vector3.up)
            {
                this.m_RestAngleFunc         = new vp_Shell.RestAngleFunc(this.UpRight);
                this.m_Rigidbody.constraints = (RigidbodyConstraints)80;
            }
            return;
        }
        this.m_RestAngleFunc = new vp_Shell.RestAngleFunc(this.TippedOver);
    }