private void Start() { if (OceanRenderer.Instance == null) { enabled = false; return; } #if UNITY_EDITOR if (EditorApplication.isPlaying && !Validate(OceanRenderer.Instance, ValidatedHelper.DebugLog)) { enabled = false; return; } #endif _localOffset = transform.localPosition; _renderer = GetComponent <Renderer>(); _mpb = new MaterialPropertyBlock(); _boat = GetComponentInParent <FloatingObjectBase>(); if (_boat == null) { _boat = transform.parent.gameObject.AddComponent <ObjectWaterInteractionAdaptor>(); } }
private void Start() { if (OceanRenderer.Instance == null || !OceanRenderer.Instance.CreateDynamicWaveSim) { enabled = false; return; } _localOffset = transform.localPosition; _dynWavesInput = GetComponent <RegisterDynWavesInput>(); if (_dynWavesInput == null) { Debug.LogError("ObjectWaterInteraction script requires RegisterDynWavesInput script to be present.", this); enabled = false; return; } _boat = GetComponentInParent <FloatingObjectBase>(); if (_boat == null) { Debug.LogError("FloatingObjectBase required. Disabling FeedVelocityToExtrude.", this); enabled = false; return; } }
private void Start() { if (OceanRenderer.Instance == null) { enabled = false; return; } #if UNITY_EDITOR if (!Validate(OceanRenderer.Instance, ValidatedHelper.DebugLog)) { enabled = false; return; } #endif _localPositionRest = transform.localPosition; _dynWavesInput = GetComponent <RegisterDynWavesInput>(); _renderer = GetComponent <Renderer>(); _mpb = new MaterialPropertyBlock(); _object = GetComponentInParent <FloatingObjectBase>(); if (_object == null) { _object = transform.parent.gameObject.AddComponent <ObjectWaterInteractionAdaptor>(); } }
private void Start() { if (OceanRenderer.Instance == null) { enabled = false; return; } #if UNITY_EDITOR if (EditorApplication.isPlaying && !Validate(OceanRenderer.Instance, ValidatedHelper.DebugLog)) { enabled = false; return; } #endif if (OceanRenderer.Instance._lodDataDynWaves == null) { // Don't run without a dyn wave sim enabled = false; return; } _renderer = GetComponent <Renderer>(); _mpb = new MaterialPropertyBlock(); _object = GetComponentInParent <FloatingObjectBase>(); if (_object == null) { _object = transform.parent.gameObject.AddComponent <ObjectWaterInteractionAdaptor>(); } }
private void Start() { if (OceanRenderer.Instance == null || !OceanRenderer.Instance.CreateDynamicWaveSim) { enabled = false; return; } _localOffset = transform.localPosition; _mat = GetComponent <Renderer>().material; _boat = GetComponentInParent <FloatingObjectBase>(); if (_boat == null) { Debug.LogError("FloatingObjectBase required. Disabling FeedVelocityToExtrude.", this); enabled = false; return; } }
private void Start() { if (OceanRenderer.Instance == null || !OceanRenderer.Instance.CreateDynamicWaveSim) { enabled = false; return; } if (transform.parent == null) { Debug.LogError("ObjectWaterInteraction script requires a parent GameObject.", this); enabled = false; return; } _localPositionRest = transform.localPosition; _dynWavesInput = GetComponent <RegisterDynWavesInput>(); if (_dynWavesInput == null) { Debug.LogError("ObjectWaterInteraction script requires RegisterDynWavesInput script to be present.", this); enabled = false; return; } _object = GetComponentInParent <FloatingObjectBase>(); if (_object == null) { _object = transform.parent.gameObject.AddComponent <ObjectWaterInteractionAdaptor>(); } _renderer = GetComponent <Renderer>(); if (_renderer == null) { Debug.LogError("ObjectWaterInteraction script requires Renderer component.", this); enabled = false; return; } _mpb = new MaterialPropertyBlock(); }