コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        ObjectiveCompanionReachPoint objective = _prerequisite.GetComponent <ObjectiveCompanionReachPoint>();

        if (objective)
        {
            _objectiveIndex = objective.GetIndex();
        }
    }
コード例 #2
0
    void Point()
    {
        (GameObject hit, Transform potentialTarget, float distance) = _watchData.GetRaycast();
        Debug.Log("Potential target: " + potentialTarget);
        ObjectiveCompanionReachPoint _objective = hit.GetComponent <ObjectiveCompanionReachPoint>();

        if (_objective && potentialTarget.position.y > _minHeight)
        {
            Debug.Log(string.Format("Destination: {0}", potentialTarget.position));
            _target = potentialTarget;
        }

        else
        {
            Debug.Log("No prey");
            _birdState = BirdState.Follow;
        }
    }