Esempio n. 1
0
    void Start()
    {
        // y = mx + b
        // topY = m(topAngle) + b
        // b = topY - m (topAngle)
        // b = bottomY - m (bottomAngle)
        // topY - m (topAngle) = bottomY - m (bottomAngle)
        // topY - bottomY = m (topAngle) - m (bottomAngle)
        // topY - bottomY = m (topAngle - bottomAngle)
        m = (topY - bottomY) / (topAngle - bottomAngle);
        b = topY - m * topAngle;

        canOpener = transform.parent.GetComponentInChildren <CanOpenerBehavior>();
    }
Esempio n. 2
0
 public void SetCanOpenerBehavior(CanOpenerBehavior canOpenerBehavior)
 {
     this.canOpenerBehavior = canOpenerBehavior;
 }