コード例 #1
0
    void OnTriggerEnter(Collider collision)
    {
        switch (collision.tag)
        {
        case "Player":
            status = aistatus.attack;
            //  InvokeRepeating("Attack", 1f, 2f);
            break;

        case "AI":
            if (nav.enabled)
            {
                //   nav.SetDestination(uppos);
            }

            break;

        case "PlayerBullet":
            //  Destroy(gameObject);

            Bulletcontroll bcontroll = collision.GetComponent <Bulletcontroll>();
            CateDownHp(bcontroll.damage);
            //  collision.transform.SetParent(transform);

            //Debug.Log("collisionPlayerBullet" + collision.name + HP);
            break;

        case "Walls":
            break;

        default:
            break;
        }
    }
コード例 #2
0
    void OnTriggerEnter(Collider collision)
    {
        //Debug.Log(collision.name);
        switch (collision.tag)
        {
        case "Player":
            acontroll.status = aistatus.attack;
            //  InvokeRepeating("Attack", 1f, 2f);
            break;

        case "AI":
            break;

        case "PlayerBullet":
            //temppos = collision.transform.position;
            Bulletcontroll bcontroll = collision.GetComponent <Bulletcontroll>();
            acontroll.CateDownHp(bcontroll.damage);
            // Debug.Log("Onhurt"+collision.transform.gameObject);
            //     Debug.Log("Onhurtif" + collision.transform.gameObject);
            //     ArrowStop(collision.transform, collision.GetComponent<TrailRenderer>()
            //         , collision.GetComponent<Rigidbody>()
            //         ,collision.GetComponent<BoxCollider>(), true);
            break;

        case "Walls":
            break;

        default:
            break;
        }
    }