예제 #1
0
    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();
        }
    }
예제 #2
0
 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;
 }