Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        leftHand = this.transform.Find("mixamorig:Hips/mixamorig:Spine/mixamorig:Spine1/mixamorig:Spine2/mixamorig:LeftShoulder/mixamorig:LeftArm/mixamorig:LeftForeArm/mixamorig:LeftHand");
        anim     = GetComponent <Animator>();
        if (anim == null)
        {
            Debug.Log("Animator could not be found");
        }
        rbody = GetComponent <Rigidbody>();
        if (rbody == null)
        {
            Debug.Log("Rigid body could not be found");
        }

        aiSteer = GetComponent <AINavSteeringController>();

        agent = GetComponent <NavMeshAgent>();

        text = GetComponent <TextMesh>();

        Debug.Log("NavMesh:avoidancePredictionTime(default): " + NavMesh.avoidancePredictionTime);

        //NavMesh.avoidancePredictionTime = 4f;

        aiSteer.Init();

        aiSteer.waypointLoop       = false;
        aiSteer.stopAtNextWaypoint = false;

        transitionToStateD();
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        aiSteer = GetComponent <AINavSteeringController>();

        aiSteer.Init();

        aiSteer.waypointLoop       = false;
        aiSteer.stopAtNextWaypoint = false;

        transitionToStateA();
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        aiSteer = GetComponent <AINavSteeringController>();

        aiSteer.Init();

        aiSteer.waypointLoop       = false;
        aiSteer.stopAtNextWaypoint = false;

        transitionToWalkingState();

        //guards don't have throwables at start
        armed = false;
    }
Esempio n. 4
0
    // Use this for initialization
    void Start()
    {
        aiSteer = GetComponent <AINavSteeringController>();

        aiSteer.Init();

        aiSteer.waypointLoop       = false;
        aiSteer.stopAtNextWaypoint = false;

        transitionToNewGoal();


        destination = transform;
    }
    // Use this for initialization
    void Start()
    {
        aiSteer = GetComponent <AINavSteeringController>();
        aiSteer.mecanimInputForwardSpeedCap = 0.75f;

        agent = GetComponent <NavMeshAgent>();

        text = GetComponent <TextMesh>();

        Debug.Log("NavMesh:avoidancePredictionTime(default): " + NavMesh.avoidancePredictionTime);

        //NavMesh.avoidancePredictionTime = 4f;

        aiSteer.Init();

        aiSteer.waypointLoop       = false;
        aiSteer.stopAtNextWaypoint = false;

        transitionToStateA();
    }
    // Use this for initialization
    void Start()
    {
        speakDelay     = 4f;
        lastSpeak      = 0f;
        greetingIdx    = 0;
        greetingDialog = new List <string>
        {
            "Ah, it's you again!",
            "I'm glad to see you're still in one piece.",
            "What's that? Of course, why wouldn't you be!",
            "You see that? That there's a Percamore laser.",
            "It'll roast you right through in a second if you're not careful!",
            "Don't worry though, there's a secret door to the next room.",
            "Then it's just a matter of...well, no one's gotten that far.",
            "Knowing the bunny boss though, it'll probably\nbe some kind of shrine or picture of him",
            "Good luck friend! And be careful!",
            ""
        };


        aiSteer = GetComponent <AINavSteeringController>();
        aiSteer.mecanimInputForwardSpeedCap = 0.75f;

        agent = GetComponent <NavMeshAgent>();

        text = GetComponentInChildren <TextMesh>();

        Debug.Log("NavMesh:avoidancePredictionTime(default): " + NavMesh.avoidancePredictionTime);

        //NavMesh.avoidancePredictionTime = 4f;

        aiSteer.Init();

        aiSteer.waypointLoop       = false;
        aiSteer.stopAtNextWaypoint = false;

        npc0Object  = this.gameObject;
        npc0Control = npc0Object.GetComponent <AIDemoControllerSimple>();

        TransitionToStateNone();
    }
    // Use this for initialization
    void Start()
    {
        speakDelay     = 4f;
        lastSpeak      = 0f;
        greetingIdx    = 0;
        greetingDialog = new List <string>
        {
            "Oh hello there",
            "...",
            "You may be wondering where you are.",
            "You are trapped so it doesn't matter",
            "but I'll tell you anyway, I've nothing else to do",
            "Outside these black walls is maze",
            "it changes occasionally and is full of monsters.",
            "I think I remember hearing something...",
            "Ah yes, if you beat four puzzles found in the maze",
            "you can escape... but no ones ever done it before.",
            ""
        };


        aiSteer = GetComponent <AINavSteeringController>();
        aiSteer.mecanimInputForwardSpeedCap = 0.75f;

        agent = GetComponent <NavMeshAgent>();

        text = GetComponentInChildren <TextMesh>();

        Debug.Log("NavMesh:avoidancePredictionTime(default): " + NavMesh.avoidancePredictionTime);

        //NavMesh.avoidancePredictionTime = 4f;

        aiSteer.Init();

        aiSteer.waypointLoop       = false;
        aiSteer.stopAtNextWaypoint = false;

        TransitionToStateNone();
    }
Esempio n. 8
0
    public override void AIStart()
    {
        base.AIStart();


        if (navController != null)
        {
            navController.Init();

            //just in case there are any set
            navController.clearWaypoints();

            navController.waypointLoop = false;

            //TODO: there are probably some other settings in
            //AINavSteeringController that need to be default and
            //aren't currently checked here.
            //Currently, they should be set in the inspector before
            //runtime.
            //At runtime, there are no getters/setters for most settings
            //so changes via script don't necessarily get "baked" correctly.
        }
    }