Question by
kirito015 · Jul 31, 2018 at 08:42 PM ·
scripting problemobject
How can i make a variable like the animator's parameters?
Hello i am trying to create a variable and i've got stuck, because i can't figure out how to get its value. can someone help me? so far i've done this:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Variable {
public string name;
public string initialValue;
public string value;
public VariableType type;
public enum VariableType
{
number,
boolean,
Text,
item
}
public void GetValue()
{
}
public static bool operator==(Variable a, Variable b)
{
float aValue = float.Parse(a.value);
float bValue = float.Parse(b.value);
return aValue == bValue;
}
public static bool operator !=(Variable a, Variable b)
{
float aValue = float.Parse(a.value);
float bValue = float.Parse(b.value);
return aValue != bValue;
}
public static bool operator< (Variable a, Variable b)
{
float aValue = float.Parse(a.value);
float bValue = float.Parse(b.value);
return aValue < bValue;
}
public static bool operator >(Variable a, Variable b)
{
float aValue = float.Parse(a.value);
float bValue = float.Parse(b.value);
return aValue > bValue;
}
public static bool operator <=(Variable a, Variable b)
{
float aValue = float.Parse(a.value);
float bValue = float.Parse(b.value);
return aValue <= bValue;
}
public static bool operator >=(Variable a, Variable b)
{
float aValue = float.Parse(a.value);
float bValue = float.Parse(b.value);
return aValue >= bValue;
}
}
i am sorry if i don't give enought details but i am not sure at all of what i want
Comment
Your answer
Follow this Question
Related Questions
I want Script To Move a object from a different object (In four Different directions,Randomly) . 0 Answers
Keep the distance of one object relative to another while changing its size 0 Answers
Problem with gravity with regidbody. 2 Answers
How to Fix this issue 1 Answer
How to assign script to object? 0 Answers