Esempio n. 1
0
        // Use this for initialization
        void Start()
        {
            _defaultPosition = transform.position;
            ResetToDefaults();

            _playerProxSwitch = GetComponent <PlayerProximitySwitch>();
            float sizeX = GetComponent <Renderer>().bounds.size.x;

            _playerProxSwitch.Range = sizeX * 0.5f;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes the object.
        /// </summary>
        private void Start()
        {
            _proxSwitch = GetComponent <PlayerProximitySwitch>();
            if (_proxSwitch == null)
            {
                Debug.LogError(Utils.GetComponentMissingString("ProximitySwitch"));
            }

            if (open)
            {
                _openProgress = 1f;
            }

            _closedRotation  = transform.rotation;
            _openRotationQ   = Quaternion.Euler(_openRotation);
            _defaultUnlocked = unlocked;
            _defaultOpen     = open;
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes the object.
 /// </summary>
 protected override void Start()
 {
     base.Start();
     _playerProxSwitch = GetComponent <PlayerProximitySwitch>();
 }