Search Unity

Question Script Declaring Variable

Discussion in 'Documentation' started by lAntonin, Apr 21, 2022.

  1. lAntonin

    lAntonin

    Joined:
    Jan 26, 2021
    Posts:
    7
    Hello, is it possible in CSharp to make the script declare himself variable ?
    Like a thing like that :
    Code (CSharp):
    1. Script.Declare(int variableName = 4);
    ?
    If it exist thank for tell me how.
    Thank to feed back...
     
  2. lAntonin

    lAntonin

    Joined:
    Jan 26, 2021
    Posts:
    7
    For solve that problem but it is another one, it is possible to declare a variable with in his name the value of another variable ? (Like that)
    Code (CSharp):
    1. int value = 3;
    2. int "Number" + value + "variable" = 10;
    Like if the int name was a string.
    Thank you for answer...