Beispiel #1
0
    public void BeginPathfind(Vector3 point)
    {
        navAgent.SetDestination(point);
        if (Vector3.Distance(transform.position, point) < 3)
        {
            Debug.Log("last click :" + Vector3.Distance(lastClick, point));
            Darkness.expand();
        }

        else
        {
            Debug.Log("moving");
            Darkness.contract();
        }

        lastClick = point;
    }
Beispiel #2
0
    void FixedUpdate()
    {
        currentPosition = transform.position;

        if (currentPosition == oldPosition)
        {
            Darkness.expand();
        }

        switch (currentState)
        {
        case State.INCREASE:
            //vector3(x,y,z)
            if (transform.localScale.x < MAX.x)
            {
                transform.localScale += v;
            }
            break;

        case State.DECREASE:
            if (transform.localScale.x > MIN.x)
            {
                transform.localScale -= v;
            }
            break;

        case State.STABLE:
            break;
        }

        if (transform.localScale.x <= MIN.x)
        {
            ;
        }
        darkConsume = true;

        oldPosition = transform.position;
        scale       = transform.localScale;
    }