Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        if (_move)
        {
            float step = 5 * Time.deltaTime;  // calculate distance to move
            transform.position = Vector3.MoveTowards(transform.position, _target.position, step);
            transform.LookAt(_target);

            if (Vector3.Distance(transform.position, _target.position) < 0.001f)
            {
                // if (_move) {
                _move = false;
                transform.rotation = Quaternion.identity;
                _visual.ShowAvailbleConnections(_location);
                // TODO Give event that cards can go up!
                // }
            }
        }
    }
    // Update is called once per frame
    void FixedUpdate()
    {
        if (_move)
        {
            float step = 5 * Time.deltaTime; // calculate distance to move
            transform.position = Vector3.MoveTowards(transform.position, _target.position, step);
            transform.LookAt(_target);

            if (Vector3.Distance(transform.position, _target.position) < 0.001f)
            {
                if (_move)
                {
                    _move = false;
                    transform.rotation = Quaternion.identity;
                    _visual.ShowAvailbleConnections(_location);
                    //call popup menu here
                    TestYNC();
                }
            }
        }
    }