コード例 #1
0
        // Use this for initialization
        void Start()
        {
            scrFpsController  = transform.root.GetComponent <ScrFpsController>();
            scrFpsWeaponPivot = transform.GetComponent <ScrFpsWeaponPivot>();
            sfxSource         = transform.root.GetComponent <ScrEffectsListener>().personalEffects;

            headCamera        = scrFpsController.headCamera.GetComponent <Camera>();
            headCameraOrigFov = headCamera.fieldOfView;

            weaponCamera        = scrFpsController.weaponCamera.GetComponent <Camera>();
            weaponCameraOrigFov = weaponCamera.fieldOfView;

            fireTimer.onIterate  += SpawnProjectiles;
            fireTimer.onCooldown += C**k;

            magazineCurrent = magazineMax;
        }
コード例 #2
0
        void Start()
        {
            scrFpsController = transform.root.GetComponent <ScrFpsController>();

            if (scrFpsController == null)
            {
                Debug.LogError("ScrFpsWeaponPivot needs ScrFpsController at the root transform!");
            }

            // Save original Rotation
            originalRotation = transform.localRotation;
            currentRotation  = originalRotation;
            originalPosition = transform.localPosition;
            currentPosition  = originalPosition;

            SetupSprings();
        }