コード例 #1
0
        private void SetupNewCollider(SphereCollider sc, MeshCollider mc)
        {
            switch (setupBoundsType.Value)
            {
            case SetupBoundsType.None:
                break;

            case SetupBoundsType.SetupFromLocalBounds:
                sc.SetFromLocalBounds();
                break;

            case SetupBoundsType.SetupFromPreciseBounds:
                sc.SetFromPreciseBounds();
                break;
            }
            if (PreserveColliderSettings)
            {
                sc.Type.Value = mc.Type.Value;
                sc.CharacterCollider.Value = mc.CharacterCollider.Value;
                sc.IgnoreRaycasts.Value    = mc.IgnoreRaycasts.Value;
                sc.Mass.Value = mc.Mass.Value;
            }
            else
            {
                sc.Type.Value = setColliderType;
                sc.CharacterCollider.Value = SetCharacterCollider;
                sc.IgnoreRaycasts.Value    = SetIgnoreRaycasts;
                sc.Mass.Value = Mass;
            }
        }