コード例 #1
0
    private void OnCollisionExit(Collision collision)
    {
        TagsExtended collTags = collision.gameObject.GetComponent <TagsExtended>();

        if (collTags == null)
        {
            return;
        }

        if (collTags.HasTag(TagsExtended.Tags.FLOOR))
        {
            onFloor = false;
        }
    }
コード例 #2
0
    private void OnCollisionExit(Collision collision)
    {
        if ((playerComp.playerFlags & PlayerComp.c_MOUNTED) == 0)
        {
            TagsExtended collTags = collision.gameObject.GetComponent <TagsExtended>();
            if (collTags == null)
            {
                return;
            }

            if (collTags.HasTag(TagsExtended.Tags.FLOOR))
            {
                onFloor = false;
            }
        }
    }
コード例 #3
0
    private void OnCollisionStay(Collision collision)
    {
        TagsExtended collTags = collision.gameObject.GetComponent <TagsExtended>();

        if (collTags == null)
        {
            return;
        }

        if (collTags.HasTag(TagsExtended.Tags.FLOOR))
        {
            YPosAtJump = -99;
            RaycastHit hit;
            if (Physics.Raycast(transform.position, -transform.up, out hit, .1f)) // check if the floor is below you, so you can't jump on walls
            {
                onFloor = true;
            }
        }
    }