상속: MonoBehaviour
예제 #1
0
    public override void Start(RAIN.Core.AI ai)
    {
        //Change the FOV Color
        FOV2DVisionCone FOV = ai.Body.transform.Find("FOV2D").GetComponent <FOV2DVisionCone>();

        FOV.status = FOV2DVisionCone.Status.Idle;
        base.Start(ai);
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        anim = GetComponentInChildren<Animator> ();
        _rigidBody = GetComponent<Rigidbody> ();
        eyes = GetComponentInChildren<FOV2DEyes>();
        visionCone = GetComponentInChildren<FOV2DVisionCone>();

        InvokeRepeating ("CheckVision", 0, 0.3f);
        //GameManager.getInstance().setPlayerPos(this.transform.position);
        soundManager = SoundManager.getInstance();
        GameManager.getInstance ().SetPlayer (this.gameObject);
    }
예제 #3
0
    public override void Start(RAIN.Core.AI ai)
    {
        //set the FOV to ALERTS
        FOV2DVisionCone FOV = ai.Body.transform.Find("FOV2D").GetComponent <FOV2DVisionCone>();

        FOV.status = FOV2DVisionCone.Status.Alert;

        Vector3 playerPos = GameObject.FindGameObjectWithTag("Player").transform.position;

        ai.WorkingMemory.SetItem <Vector3>("destination", playerPos);
        base.Start(ai);
    }
    // Use this for initialization
    void Awake()
    {
        // Setting up the reference
        sleepingScript = GetComponent<SleepingScript>();
        personSight = GetComponent<PersonSight>();
        suspicion = GetComponent<Suspicion>();
        nav = GetComponent<NavMeshAgent>();
        santa = GameObject.FindGameObjectWithTag("Player").transform;
        fovEyesScript = GetComponent<FOV2DEyes>();
        fovConeScript = GetComponent<FOV2DVisionCone>();

        touchObject = this.transform.FindChild("SenseTouch").gameObject;
        woken = touchObject.GetComponent<Woken>();
    }
예제 #5
0
    public override void Start(RAIN.Core.AI ai)
    {
        Bang  bang    = GameObject.Instantiate(ai.WorkingMemory.GetItem("bang") as GameObject).GetComponent <Bang> ();
        float yOffset = ai.Body.GetComponent <CapsuleCollider>().bounds.size.y;

        yOffset += 1.2f;
        Vector3 copPosition = ai.Body.transform.position;

        bang.transform.position = new Vector3(copPosition.x,
                                              copPosition.y + yOffset,
                                              copPosition.z);
        bang.transform.SetParent(ai.Body.transform, true);

        //Change the FOV Color
        FOV2DVisionCone FOV = ai.Body.transform.Find("FOV2D").GetComponent <FOV2DVisionCone>();

        FOV.status = FOV2DVisionCone.Status.Alert;

        base.Start(ai);
    }
예제 #6
0
 void Start()
 {
     eyes = GetComponentInChildren<FOV2DEyes>();
     visionCone = GetComponentInChildren<FOV2DVisionCone>();
 }
예제 #7
0
 void Start()
 {
     eyes       = GetComponentInChildren <FOV2DEyes>();
     visionCone = GetComponentInChildren <FOV2DVisionCone>();
 }
예제 #8
0
    void Start()
    {
        GameManager.getInstance ().addGuardListener (this);
        anim = GetComponent<Animator> ();
        agent = GetComponent<NavMeshAgent>();
        eyes = GetComponentInChildren<FOV2DEyes>();
        visionCone = GetComponentInChildren<FOV2DVisionCone>();
        currentState = State.IDLE;
        // Disabling auto-braking allows for continuous movement
        // between points (ie, the agent doesn't slow down as it
        // approaches a destination point).
        agent.autoBraking = false;
        agent.Stop ();
        // Set the agent to go to the currently selected destination.
        agent.destination = point.position;

        InvokeRepeating ("CheckVision", 0, 0.3f);
    }