// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ override protected void Update() { base.Update(); if (softClip == null) { softClip = GetComponent <exSoftClip>(); if (softClip == null) { Debug.LogError("Can't find exSoftClip Component in GameObject " + gameObject.name); return; } } // if ( lastCenter != softClip.center ) { // lastCenter = softClip.center; // } if (lastWidth != softClip.width) { lastWidth = softClip.width; softClip.updateFlags |= exPlane.UpdateFlags.Vertex; } if (lastHeight != softClip.height) { lastHeight = softClip.height; softClip.updateFlags |= exPlane.UpdateFlags.Vertex; } }
/////////////////////////////////////////////////////////////////////////////// // functions /////////////////////////////////////////////////////////////////////////////// // ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ protected new void Awake () { base.Awake(); softClip = GetComponent<exSoftClip>(); // lastCenter = softClip.center; lastWidth = softClip.width; lastHeight = softClip.height; }
/////////////////////////////////////////////////////////////////////////////// // functions /////////////////////////////////////////////////////////////////////////////// // ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ void Awake() { clipPlane = GetComponent<exSoftClip>(); if (clipPlane) { //Debug.Log(clipPlane); } totalWidth = clipPlane.width; clipPlane.width = totalWidth * ratio_; }
/////////////////////////////////////////////////////////////////////////////// // functions /////////////////////////////////////////////////////////////////////////////// // ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ override protected void Awake() { base.Awake(); softClip = GetComponent <exSoftClip>(); // lastCenter = softClip.center; lastWidth = softClip.width; lastHeight = softClip.height; }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ void RecursivelyAddToClip(Transform _t) { foreach (Transform child in _t) { exPlane plane = child.GetComponent <exPlane>(); if (plane != null) { planes.Add(plane); exSoftClip clipPlane = plane as exSoftClip; // if this is a clip plane, add child to it if (clipPlane != null) { clipPlane.UpdateClipList(); continue; } } RecursivelyAddToClip(child); } }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ protected new void Update () { base.Update(); if ( softClip == null ) { softClip = GetComponent<exSoftClip>(); if ( softClip == null ) { Debug.LogError("Can't find exSoftClip Component in GameObject " + gameObject.name); return; } } // if ( lastCenter != softClip.center ) { // lastCenter = softClip.center; // } if ( lastWidth != softClip.width ) { lastWidth = softClip.width; softClip.updateFlags |= exPlane.UpdateFlags.Vertex; } if ( lastHeight != softClip.height ) { lastHeight = softClip.height; softClip.updateFlags |= exPlane.UpdateFlags.Vertex; } }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ public void AddToSoftClipList(exSoftClip _softClip) { softClips.Add(_softClip); }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ public void AddToSoftClipList( exSoftClip _softClip ) { softClips.Add (_softClip); }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ public void RemoveFromSoftClipList ( exSoftClip _softClip ) { softClips.Remove (_softClip); }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ public void AddToSoftClipList ( exSoftClip _softClip ) { if ( softClips.IndexOf(_softClip) == -1 ) softClips.Add (_softClip); }