Ejemplo n.º 1
0
 public SkillString(SkillString source) : base(source)
 {
     if (source != null)
     {
         this.value = source.value;
     }
 }
Ejemplo n.º 2
0
 public void ResetParameters()
 {
     this.excludeSelf    = false;
     this.gameObject     = null;
     this.fsmName        = "";
     this.sendToChildren = false;
     this.fsmComponent   = null;
 }
Ejemplo n.º 3
0
 public SkillEventTarget(SkillEventTarget source)
 {
     this.target         = source.target;
     this.excludeSelf    = new SkillBool(source.excludeSelf);
     this.gameObject     = new SkillOwnerDefault(source.gameObject);
     this.fsmName        = new SkillString(source.fsmName);
     this.sendToChildren = new SkillBool(source.sendToChildren);
     this.fsmComponent   = source.fsmComponent;
 }
Ejemplo n.º 4
0
 public void ResetParameters()
 {
     this.BoolParameter       = false;
     this.FloatParameter      = 0f;
     this.IntParameter        = 0;
     this.StringParameter     = "";
     this.GameObjectParameter = new SkillGameObject("");
     this.Vector2Parameter    = new SkillVector2();
     this.Vector3Parameter    = new SkillVector3();
     this.RectParamater       = new SkillRect();
     this.QuaternionParameter = new SkillQuaternion();
     this.ObjectParameter     = new SkillObject();
     this.MaterialParameter   = new SkillMaterial();
     this.TextureParameter    = new SkillTexture();
     this.ColorParameter      = new SkillColor();
     this.EnumParameter       = new SkillEnum();
     this.ArrayParameter      = new SkillArray();
 }
Ejemplo n.º 5
0
 public FunctionCall(FunctionCall source)
 {
     this.FunctionName        = source.FunctionName;
     this.parameterType       = source.parameterType;
     this.BoolParameter       = new SkillBool(source.BoolParameter);
     this.FloatParameter      = new SkillFloat(source.FloatParameter);
     this.IntParameter        = new SkillInt(source.IntParameter);
     this.GameObjectParameter = new SkillGameObject(source.GameObjectParameter);
     this.ObjectParameter     = source.ObjectParameter;
     this.StringParameter     = new SkillString(source.StringParameter);
     this.Vector2Parameter    = new SkillVector2(source.Vector2Parameter);
     this.Vector3Parameter    = new SkillVector3(source.Vector3Parameter);
     this.RectParamater       = new SkillRect(source.RectParamater);
     this.QuaternionParameter = new SkillQuaternion(source.QuaternionParameter);
     this.MaterialParameter   = new SkillMaterial(source.MaterialParameter);
     this.TextureParameter    = new SkillTexture(source.TextureParameter);
     this.ColorParameter      = new SkillColor(source.ColorParameter);
     this.EnumParameter       = new SkillEnum(source.EnumParameter);
     this.ArrayParameter      = new SkillArray(source.ArrayParameter);
 }
Ejemplo n.º 6
0
 public SkillProperty(SkillProperty source)
 {
     this.setProperty         = source.setProperty;
     this.TargetObject        = new SkillObject(source.TargetObject);
     this.TargetTypeName      = source.TargetTypeName;
     this.TargetType          = source.TargetType;
     this.PropertyName        = source.PropertyName;
     this.PropertyType        = source.PropertyType;
     this.BoolParameter       = new SkillBool(source.BoolParameter);
     this.FloatParameter      = new SkillFloat(source.FloatParameter);
     this.IntParameter        = new SkillInt(source.IntParameter);
     this.GameObjectParameter = new SkillGameObject(source.GameObjectParameter);
     this.StringParameter     = new SkillString(source.StringParameter);
     this.Vector2Parameter    = new SkillVector2(source.Vector2Parameter);
     this.Vector3Parameter    = new SkillVector3(source.Vector3Parameter);
     this.RectParamater       = new SkillRect(source.RectParamater);
     this.QuaternionParameter = new SkillQuaternion(source.QuaternionParameter);
     this.ObjectParameter     = new SkillObject(source.ObjectParameter);
     this.MaterialParameter   = new SkillMaterial(source.MaterialParameter);
     this.TextureParameter    = new SkillTexture(source.TextureParameter);
     this.ColorParameter      = new SkillColor(source.ColorParameter);
     this.EnumParameter       = new SkillEnum(source.EnumParameter);
     this.ArrayParameter      = new SkillArray(source.ArrayParameter);
 }
Ejemplo n.º 7
0
 public static bool IsNullOrEmpty(SkillString fsmString)
 {
     return(fsmString == null || fsmString.IsNone || string.IsNullOrEmpty(fsmString.value));
 }
Ejemplo n.º 8
0
        public void SetVariable(NamedVariable variable)
        {
            if (variable == null)
            {
                this.ResetParameters();
                return;
            }
            switch (variable.VariableType)
            {
            case VariableType.Unknown:
                return;

            case VariableType.Float:
                this.FloatParameter = (variable as SkillFloat);
                return;

            case VariableType.Int:
                this.IntParameter = (variable as SkillInt);
                return;

            case VariableType.Bool:
                this.BoolParameter = (variable as SkillBool);
                return;

            case VariableType.GameObject:
                this.GameObjectParameter = (variable as SkillGameObject);
                return;

            case VariableType.String:
                this.StringParameter = (variable as SkillString);
                return;

            case VariableType.Vector2:
                this.Vector2Parameter = (variable as SkillVector2);
                return;

            case VariableType.Vector3:
                this.Vector3Parameter = (variable as SkillVector3);
                return;

            case VariableType.Color:
                this.ColorParameter = (variable as SkillColor);
                return;

            case VariableType.Rect:
                this.RectParamater = (variable as SkillRect);
                return;

            case VariableType.Material:
                this.MaterialParameter = (variable as SkillMaterial);
                return;

            case VariableType.Texture:
                this.TextureParameter = (variable as SkillTexture);
                return;

            case VariableType.Quaternion:
                this.QuaternionParameter = (variable as SkillQuaternion);
                return;

            case VariableType.Object:
                this.ObjectParameter = (variable as SkillObject);
                return;

            case VariableType.Array:
                this.ArrayParameter = (variable as SkillArray);
                return;

            case VariableType.Enum:
                this.EnumParameter = (variable as SkillEnum);
                return;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Ejemplo n.º 9
0
 public void Init()
 {
     if (this.TargetObject == null)
     {
         return;
     }
     this.initialized        = true;
     this.targetObjectCached = this.TargetObject.Value;
     if (this.TargetObject.UseVariable)
     {
         this.TargetTypeName = this.TargetObject.TypeName;
         this.TargetType     = this.TargetObject.ObjectType;
     }
     else
     {
         if (this.TargetObject.Value != null)
         {
             this.TargetType     = this.TargetObject.Value.GetType();
             this.TargetTypeName = this.TargetType.get_FullName();
         }
     }
     if (!string.IsNullOrEmpty(this.PropertyName))
     {
         this.memberInfo = ReflectionUtils.GetMemberInfo(this.TargetType, this.PropertyName);
         if (object.ReferenceEquals(this.memberInfo, null))
         {
             this.PropertyName = "";
             this.PropertyType = null;
             this.ResetParameters();
             return;
         }
         this.PropertyType = ReflectionUtils.GetMemberUnderlyingType(this.memberInfo[this.memberInfo.Length - 1]);
     }
     if (!object.ReferenceEquals(this.PropertyType, null) && this.PropertyType.get_IsEnum() && !SkillString.IsNullOrEmpty(this.StringParameter))
     {
         this.EnumParameter = new SkillEnum("")
         {
             EnumType = this.PropertyType,
             Value    = (Enum)Enum.Parse(this.PropertyType, this.StringParameter.Value)
         };
         this.StringParameter.Value = null;
     }
 }