Esempio n. 1
0
        void Start()
        {
            grabClipArea = GetComponentInChildren <GrabberArea>();

            if (transform.parent != null)
            {
                parentWeapon = transform.parent.GetComponent <RaycastWeapon>();
            }
        }
Esempio n. 2
0
        void Start()
        {
            if (GameObject.FindGameObjectWithTag("Player"))
            {
                input = GameObject.FindGameObjectWithTag("Player").GetComponent <InputBridge>();
            }

            grabClipArea = GetComponentInChildren <GrabberArea>();

            if (transform.parent != null)
            {
                parentWeapon = transform.parent.GetComponent <RaycastWeapon>();
            }
        }
Esempio n. 3
0
        void Start()
        {
            initialLocalPos = transform.localPosition;
            audioSource     = GetComponent <AudioSource>();
            parentWeapon    = transform.parent.GetComponent <RaycastWeapon>();
            parentGrabbable = transform.parent.GetComponent <Grabbable>();
            thisGrabbable   = GetComponent <Grabbable>();
            rigid           = GetComponent <Rigidbody>();
            initialMass     = rigid.mass;

            if (parentWeapon != null)
            {
                Physics.IgnoreCollision(GetComponent <Collider>(), parentWeapon.GetComponent <Collider>());
            }
        }
Esempio n. 4
0
        void Awake()
        {
            grabClipArea = GetComponentInChildren <GrabberArea>();

            if (transform.parent != null)
            {
                parentWeapon = transform.parent.GetComponent <RaycastWeapon>();
            }

            // Check to see if we started with a loaded magazine
            if (HeldMagazine != null)
            {
                AttachGrabbableMagazine(HeldMagazine, HeldMagazine.GetComponent <Collider>());
            }
        }