コード例 #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();
    }
コード例 #2
0
ファイル: AIController.cs プロジェクト: Biakuyass/MazeGame
    // private bool predictChase = false;

    //public Transform preyStartPoint;
    //public Transform preyEndPoint;
    //public float preyMoveTime;
    // Use this for initialization
    void Start()
    {
        ainav = gameObject.GetComponent <AINavSteeringController>();
        anim  = gameObject.GetComponent <Animator>();
        agent = gameObject.GetComponent <NavMeshAgent>();
        Patrol();
        // Chase();
        //PrepareThrow();
    }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        aiSteer = GetComponent <AINavSteeringController>();

        aiSteer.Init();

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

        transitionToStateA();
    }
コード例 #4
0
ファイル: AIGuardController.cs プロジェクト: lkm027/CS4460
    // 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;
    }
コード例 #5
0
ファイル: AIPrisonerController.cs プロジェクト: lkm027/CS4460
    // Use this for initialization
    void Start()
    {
        aiSteer = GetComponent <AINavSteeringController>();

        aiSteer.Init();

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

        transitionToNewGoal();


        destination = transform;
    }
コード例 #6
0
    public override void BodyInit()
    {
        base.BodyInit();


        navController = AI.Body.GetComponent <AINavSteeringController>();

        agent = AI.Body.GetComponent <NavMeshAgent>();

        if (navController == null || agent == null)
        {
            Debug.LogWarning("NavMeshAgent and/or AINavSteeringController not found!");
        }
    }
コード例 #7
0
    // 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();
    }
コード例 #8
0
    // 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();
    }
コード例 #9
0
    // 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();
    }