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>(); }
public void SetCanOpenerBehavior(CanOpenerBehavior canOpenerBehavior) { this.canOpenerBehavior = canOpenerBehavior; }