Esempio n. 1
0
        public static VariableType GetVariableType(INamedVariable variable)
        {
            if (variable == null)
            {
                return(VariableType.Unknown);
            }
            Type type = variable.GetType();

            if (object.ReferenceEquals(type, typeof(FsmMaterial)))
            {
                return(VariableType.Material);
            }
            if (object.ReferenceEquals(type, typeof(FsmTexture)))
            {
                return(VariableType.Texture);
            }
            if (object.ReferenceEquals(type, typeof(FsmFloat)))
            {
                return(VariableType.Float);
            }
            if (object.ReferenceEquals(type, typeof(FsmInt)))
            {
                return(VariableType.Int);
            }
            if (object.ReferenceEquals(type, typeof(FsmBool)))
            {
                return(VariableType.Bool);
            }
            if (object.ReferenceEquals(type, typeof(FsmString)))
            {
                return(VariableType.String);
            }
            if (object.ReferenceEquals(type, typeof(FsmGameObject)))
            {
                return(VariableType.GameObject);
            }
            if (object.ReferenceEquals(type, typeof(FsmVector2)))
            {
                return(VariableType.Vector2);
            }
            if (object.ReferenceEquals(type, typeof(FsmVector3)))
            {
                return(VariableType.Vector3);
            }
            if (object.ReferenceEquals(type, typeof(FsmRect)))
            {
                return(VariableType.Rect);
            }
            if (object.ReferenceEquals(type, typeof(FsmQuaternion)))
            {
                return(VariableType.Quaternion);
            }
            if (object.ReferenceEquals(type, typeof(FsmColor)))
            {
                return(VariableType.Color);
            }
            if (object.ReferenceEquals(type, typeof(FsmObject)))
            {
                return(VariableType.Object);
            }
            if (object.ReferenceEquals(type, typeof(FsmEnum)))
            {
                return(VariableType.Enum);
            }
            if (object.ReferenceEquals(type, typeof(FsmArray)))
            {
                return(VariableType.Array);
            }
            return(VariableType.Unknown);
        }
Esempio n. 2
0
        public static VariableType GetVariableType(INamedVariable variable)
        {
            if (variable == null)
            {
                return(VariableType.Unknown);
            }
            Type type = variable.GetType();

            if (object.ReferenceEquals(type, typeof(SkillMaterial)))
            {
                return(VariableType.Material);
            }
            if (object.ReferenceEquals(type, typeof(SkillTexture)))
            {
                return(VariableType.Texture);
            }
            if (object.ReferenceEquals(type, typeof(SkillFloat)))
            {
                return(VariableType.Float);
            }
            if (object.ReferenceEquals(type, typeof(SkillInt)))
            {
                return(VariableType.Int);
            }
            if (object.ReferenceEquals(type, typeof(SkillBool)))
            {
                return(VariableType.Bool);
            }
            if (object.ReferenceEquals(type, typeof(SkillString)))
            {
                return(VariableType.String);
            }
            if (object.ReferenceEquals(type, typeof(SkillGameObject)))
            {
                return(VariableType.GameObject);
            }
            if (object.ReferenceEquals(type, typeof(SkillVector2)))
            {
                return(VariableType.Vector2);
            }
            if (object.ReferenceEquals(type, typeof(SkillVector3)))
            {
                return(VariableType.Vector3);
            }
            if (object.ReferenceEquals(type, typeof(SkillRect)))
            {
                return(VariableType.Rect);
            }
            if (object.ReferenceEquals(type, typeof(SkillQuaternion)))
            {
                return(VariableType.Quaternion);
            }
            if (object.ReferenceEquals(type, typeof(SkillColor)))
            {
                return(VariableType.Color);
            }
            if (object.ReferenceEquals(type, typeof(SkillObject)))
            {
                return(VariableType.Object);
            }
            if (object.ReferenceEquals(type, typeof(SkillEnum)))
            {
                return(VariableType.Enum);
            }
            if (object.ReferenceEquals(type, typeof(SkillArray)))
            {
                return(VariableType.Array);
            }
            return(VariableType.Unknown);
        }