Esempio n. 1
0
    // ------------------------------------------------------------------
    // 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;
    }
Esempio n. 3
0
 ///////////////////////////////////////////////////////////////////////////////
 // functions
 ///////////////////////////////////////////////////////////////////////////////
 // ------------------------------------------------------------------
 // Desc:
 // ------------------------------------------------------------------
 void Awake()
 {
     clipPlane = GetComponent<exSoftClip>();
     if (clipPlane) {
         //Debug.Log(clipPlane);
     }
     totalWidth = clipPlane.width;
     clipPlane.width = totalWidth * ratio_;
 }
Esempio n. 4
0
    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////

    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    override protected void Awake()
    {
        base.Awake();

        softClip = GetComponent <exSoftClip>();
        // lastCenter = softClip.center;
        lastWidth  = softClip.width;
        lastHeight = softClip.height;
    }
Esempio n. 5
0
    // ------------------------------------------------------------------
    // 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;
        }
    }
Esempio n. 7
0
    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    public void AddToSoftClipList(exSoftClip _softClip)
    {
        softClips.Add(_softClip);
    }
Esempio n. 8
0
 // ------------------------------------------------------------------
 // Desc:
 // ------------------------------------------------------------------
 public void AddToSoftClipList( exSoftClip _softClip )
 {
     softClips.Add (_softClip);
 }
Esempio n. 9
0
    // ------------------------------------------------------------------ 
    // Desc: 
    // ------------------------------------------------------------------ 

    public void RemoveFromSoftClipList ( exSoftClip _softClip ) {
        softClips.Remove (_softClip);
    }
Esempio n. 10
0
    // ------------------------------------------------------------------ 
    // Desc: 
    // ------------------------------------------------------------------ 

    public void AddToSoftClipList ( exSoftClip _softClip ) {
        if ( softClips.IndexOf(_softClip) == -1 )
            softClips.Add (_softClip);
    }