// 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; }
/// <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; }
/// <summary> /// Initializes the object. /// </summary> protected override void Start() { base.Start(); _playerProxSwitch = GetComponent <PlayerProximitySwitch>(); }