コード例 #1
0
ファイル: AC_Trigger.cs プロジェクト: Keraunic-Tonic/GJ2021
        protected void DrawGizmos()
        {
            Color gizmoColor = ACEditorPrefs.TriggerGizmoColor;

            PolygonCollider2D polygonCollider2D = GetComponent <PolygonCollider2D>();

            if (polygonCollider2D)
            {
                AdvGame.DrawPolygonCollider(transform, polygonCollider2D, gizmoColor);
            }
            else
            {
                MeshCollider meshCollider = GetComponent <MeshCollider>();
                if (meshCollider)
                {
                    AdvGame.DrawMeshCollider(transform, meshCollider.sharedMesh, gizmoColor);
                }
                else
                {
                    SphereCollider sphereCollider = GetComponent <SphereCollider>();
                    if (sphereCollider)
                    {
                        AdvGame.DrawSphereCollider(transform, sphereCollider, gizmoColor);
                    }
                    else
                    {
                        CapsuleCollider capsuleCollider = GetComponent <CapsuleCollider>();
                        if (capsuleCollider)
                        {
                            AdvGame.DrawCapsule(transform, capsuleCollider.center, capsuleCollider.radius, capsuleCollider.height, gizmoColor);
                        }
                        else
                        {
                            CharacterController characterController = GetComponent <CharacterController>();
                            if (characterController)
                            {
                                AdvGame.DrawCapsule(transform, characterController.center, characterController.radius, characterController.height, gizmoColor);
                            }
                            else
                            {
                                if (GetComponent <BoxCollider>() || GetComponent <BoxCollider2D>())
                                {
                                    AdvGame.DrawCubeCollider(transform, gizmoColor);
                                }
                            }
                        }
                    }
                }
            }
        }