示例#1
0
    private void OnCollisionEnter(Collision other)
    {
        switch (other.gameObject.tag)
        {
        case "Avatar":
            _avaColl = true;
            break;

        case "Shell":
            break;

        case "Meteor":
            _behaviour?.Stop();
            break;

        case "Car":
            break;

        case "Road":
            break;

        default:
            throw new ArgumentException("Wrong tag: " + other.gameObject.tag);
        }
        _behaviour?.HandleCollisionEnter(other);
    }