コード例 #1
0
    public virtual void OnPickUp()
    {
        Debug.Log("Pickup");
        this.transform.parent    = PickUpManager.GetInstance().guiCamera.transform;
        this.transform.position  = PickUpManager.GetInstance().EmptyPosition.transform.position;
        this.transform.position += this.Offset;
        this.transform.rotation  = Quaternion.Euler(Rotation);
        origScale = this.transform.localScale;
        this.transform.localScale = this.Scale;


        Rigidbody rb = this.GetComponent <Rigidbody>();

        if (rb != null)
        {
            rb.detectCollisions = false;
            rb.useGravity       = false;
            rb.freezeRotation   = true;
            rb.velocity         = Vector3.zero;
        }
    }