예제 #1
0
    // Use this for initialization
    private void Awake()
    {
        lastMove.y = -1;
        isSpotted  = false;

        myRigidbody   = GetComponent <Rigidbody2D>();
        anim          = GetComponent <Animator>();
        myAudioSource = GetComponent <AudioSource>();
        myRenderer    = GetComponent <Renderer>();

        equip     = 0;
        gun       = transform.Find("Gun").gameObject.GetComponent <GunControl>();
        crosshair = transform.Find("Crosshair").gameObject;

        soundManager = GameObject.Find("Sound Manager").GetComponent <SoundManager>();

        bowData = new BowData();

        moveSpeed = defaultSpeed;

        health = maxHealth;

        searchableArea = transform.Find("Searchable Area").GetComponent <PlayerSearchableArea>();

        flashlight = transform.Find("Flashlight").gameObject;
    }
예제 #2
0
    private void Awake()
    {
        ai = GetComponent <Pathfinding.IAstarAI>();

        player         = GameObject.Find("Player").GetComponent <PlayerControl>();
        searchableArea = player.searchableArea;
    }