コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        tanah = Physics2D.OverlapCircle(deteksitanah.position, jangkauan, targetlayer);


        if (playerInTerritory == true)
        {
            Debug.Log("Player berada di area");
            basicenemy.MoveToPlayer();
        }

        if (playerInTerritory == false)
        {
            Debug.Log("Player di luar area");
            basicenemy.Rest();
        }
    }