예제 #1
0
    public override TaskStatus OnUpdate()
    {
        AISign aiSign = aiSignsHolder.getRandomAISign(aiSignLabelName.Value);

        if (aiSign != null)
        {
            lookAtTarget.SetValue(aiSign.transform);
            return(TaskStatus.Success);
        }
        else
        {
            lookAtTarget.SetValue(null);
            return(TaskStatus.Failure);
        }
    }
예제 #2
0
        public void SetNavPoint(Transform navpoint)
        {
            if (_behavior_tree == null)
            {
                return;
            }
            SharedTransform innernav = (SharedTransform)_behavior_tree.GetVariable(AITreeArg.NavTarget);

            if (innernav != null)
            {
                innernav.SetValue(navpoint);
            }
        }
예제 #3
0
    public Transform[] randomWaypoints; // Array of all possible waypoints

    public override TaskStatus OnUpdate()
    {
        // Generate Waypoint based on selected type
        switch (waypointType)
        {
        case waypointSelection.Random:
            // Set Random Waypoint
            int currentWaypoint = Random.Range(0, randomWaypoints.Length);
            generatedWaypoint.SetValue(randomWaypoints[currentWaypoint]);
            break;

        case waypointSelection.Target:
            break;
        }

        return(TaskStatus.Success);
    }