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

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.

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 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.

Source Link
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?