Пример #1
0
 // Use this for initialization
 private void Start()
 {
     GetKeepToVector = () => transform.right;
     GameManager.instance.notificationManager.CallOnMessage(Message.BallIsUnpossessed, BecameUnpossessed);
     GameManager.instance.notificationManager.CallOnMessageWithSender(Message.BallIsPossessed,
                                                                      BecamePossessed);
 }
Пример #2
0
    private void BecamePossessed(object ballObj)
    {
        Ball ball = ballObj as Ball;

        if (ball == null)
        {
            return;
        }

        float angleDifference = Vector2.SignedAngle(ball.Owner.transform.right, transform.right);

        GetKeepToVector = () => Utility.RotateVector(ball.Owner.transform.right, angleDifference);
    }
Пример #3
0
    private void BecameUnpossessed()
    {
        Vector3 right = transform.right;

        GetKeepToVector = () => right;
    }