public virtual void OnEnable() { _linkedSpawnedObject = (LinkedSpawnedObject)target; _renderer = _linkedSpawnedObject.GetComponent <Renderer>(); _style = new GUIStyle(); _style.normal.textColor = Color.green; if (_linkedSpawnedObject.In == Vector3.zero && _linkedSpawnedObject.Out == Vector3.zero) { ResetInOutPosition(); } }
protected virtual void ResetInOutPosition() { _linkedSpawnedObject.In = _linkedSpawnedObject.transform.InverseTransformPoint(_linkedSpawnedObject.GetComponent <Renderer>().bounds.min); _linkedSpawnedObject.Out = _linkedSpawnedObject.transform.InverseTransformPoint(_linkedSpawnedObject.GetComponent <Renderer>().bounds.max); _linkedSpawnedObject.InOutSetup = true; }