Skip to main content
2 of 2
added 552 characters in body; edited tags
KALALEX
  • 115
  • 9

Accessing colliders from one script C#

I want to access specific colliders(to see if they are been clicked) from one script insted of making multiple scripts for every collider.How?

I am using unity.

using UnityEngine;
using System.Collections;

public class MainMenuManager3D : MonoBehaviour
{
    public enum Menu
    {
        MainMenu,
        NewGameMenu,
        LoadGameMenu,
        OptionsMenu,
        GameSettingsMenu,
        GameGraphicsMenu,
        Exit
    }
    public Menu currentMenu;
}

I want to change the currentMenu based on which collider is clicked in this script. Insted of making 99999 scripts for every collider.

KALALEX
  • 115
  • 9