コード例 #1
0
 public FsmQuaternion(FsmQuaternion source)
     : base(source)
 {
     if (source != null)
     {
         value = source.value;
     }
 }
コード例 #2
0
ファイル: FsmUtility.cs プロジェクト: smdx24/CPI-Source-Code
        public static ICollection <byte> FsmQuaternionToByteArray(FsmQuaternion fsmQuaternion)
        {
            if (fsmQuaternion == null)
            {
                fsmQuaternion = new FsmQuaternion();
            }
            List <byte> list = new List <byte>();

            list.AddRange(QuaternionToByteArray(fsmQuaternion.Value));
            list.AddRange(BitConverter.GetBytes(fsmQuaternion.UseVariable));
            list.AddRange(StringToByteArray(fsmQuaternion.Name));
            return(list);
        }
コード例 #3
0
ファイル: FsmUtility.cs プロジェクト: smdx24/CPI-Source-Code
        public static FsmQuaternion ByteArrayToFsmQuaternion(Fsm fsm, byte[] bytes, int startIndex, int totalLength)
        {
            string @string = Encoding.GetString(bytes, startIndex + 17, totalLength - 17);

            if (@string != string.Empty)
            {
                return(fsm.GetFsmQuaternion(@string));
            }
            FsmQuaternion fsmQuaternion = new FsmQuaternion();

            fsmQuaternion.Value       = ByteArrayToQuaternion(bytes, startIndex);
            fsmQuaternion.UseVariable = BitConverter.ToBoolean(bytes, startIndex + 16);
            return(fsmQuaternion);
        }
コード例 #4
0
ファイル: FsmProperty.cs プロジェクト: smdx24/CPI-Source-Code
 public void ResetParameters()
 {
     BoolParameter       = false;
     FloatParameter      = 0f;
     IntParameter        = 0;
     StringParameter     = "";
     GameObjectParameter = new FsmGameObject("");
     Vector2Parameter    = new FsmVector2();
     Vector3Parameter    = new FsmVector3();
     RectParamater       = new FsmRect();
     QuaternionParameter = new FsmQuaternion();
     ObjectParameter     = new FsmObject();
     MaterialParameter   = new FsmMaterial();
     TextureParameter    = new FsmTexture();
     ColorParameter      = new FsmColor();
     EnumParameter       = new FsmEnum();
     ArrayParameter      = new FsmArray();
 }
コード例 #5
0
 public FunctionCall(FunctionCall source)
 {
     FunctionName        = source.FunctionName;
     parameterType       = source.parameterType;
     BoolParameter       = new FsmBool(source.BoolParameter);
     FloatParameter      = new FsmFloat(source.FloatParameter);
     IntParameter        = new FsmInt(source.IntParameter);
     GameObjectParameter = new FsmGameObject(source.GameObjectParameter);
     ObjectParameter     = source.ObjectParameter;
     StringParameter     = new FsmString(source.StringParameter);
     Vector2Parameter    = new FsmVector2(source.Vector2Parameter);
     Vector3Parameter    = new FsmVector3(source.Vector3Parameter);
     RectParamater       = new FsmRect(source.RectParamater);
     QuaternionParameter = new FsmQuaternion(source.QuaternionParameter);
     MaterialParameter   = new FsmMaterial(source.MaterialParameter);
     TextureParameter    = new FsmTexture(source.TextureParameter);
     ColorParameter      = new FsmColor(source.ColorParameter);
     EnumParameter       = new FsmEnum(source.EnumParameter);
     ArrayParameter      = new FsmArray(source.ArrayParameter);
 }
コード例 #6
0
ファイル: FsmProperty.cs プロジェクト: smdx24/CPI-Source-Code
 public FsmProperty(FsmProperty source)
 {
     setProperty         = source.setProperty;
     TargetObject        = new FsmObject(source.TargetObject);
     TargetTypeName      = source.TargetTypeName;
     TargetType          = source.TargetType;
     PropertyName        = source.PropertyName;
     PropertyType        = source.PropertyType;
     BoolParameter       = new FsmBool(source.BoolParameter);
     FloatParameter      = new FsmFloat(source.FloatParameter);
     IntParameter        = new FsmInt(source.IntParameter);
     GameObjectParameter = new FsmGameObject(source.GameObjectParameter);
     StringParameter     = new FsmString(source.StringParameter);
     Vector2Parameter    = new FsmVector2(source.Vector2Parameter);
     Vector3Parameter    = new FsmVector3(source.Vector3Parameter);
     RectParamater       = new FsmRect(source.RectParamater);
     QuaternionParameter = new FsmQuaternion(source.QuaternionParameter);
     ObjectParameter     = new FsmObject(source.ObjectParameter);
     MaterialParameter   = new FsmMaterial(source.MaterialParameter);
     TextureParameter    = new FsmTexture(source.TextureParameter);
     ColorParameter      = new FsmColor(source.ColorParameter);
     EnumParameter       = new FsmEnum(source.EnumParameter);
     ArrayParameter      = new FsmArray(source.ArrayParameter);
 }
コード例 #7
0
ファイル: FsmProperty.cs プロジェクト: smdx24/CPI-Source-Code
        public void SetVariable(NamedVariable variable)
        {
            if (variable == null)
            {
                ResetParameters();
                return;
            }
            switch (variable.VariableType)
            {
            case VariableType.Float:
                FloatParameter = variable as FsmFloat;
                break;

            case VariableType.Int:
                IntParameter = variable as FsmInt;
                break;

            case VariableType.Bool:
                BoolParameter = variable as FsmBool;
                break;

            case VariableType.GameObject:
                GameObjectParameter = variable as FsmGameObject;
                break;

            case VariableType.String:
                StringParameter = variable as FsmString;
                break;

            case VariableType.Vector2:
                Vector2Parameter = variable as FsmVector2;
                break;

            case VariableType.Vector3:
                Vector3Parameter = variable as FsmVector3;
                break;

            case VariableType.Color:
                ColorParameter = variable as FsmColor;
                break;

            case VariableType.Rect:
                RectParamater = variable as FsmRect;
                break;

            case VariableType.Material:
                MaterialParameter = variable as FsmMaterial;
                break;

            case VariableType.Texture:
                TextureParameter = variable as FsmTexture;
                break;

            case VariableType.Quaternion:
                QuaternionParameter = variable as FsmQuaternion;
                break;

            case VariableType.Object:
                ObjectParameter = variable as FsmObject;
                break;

            case VariableType.Array:
                ArrayParameter = variable as FsmArray;
                break;

            case VariableType.Enum:
                EnumParameter = variable as FsmEnum;
                break;

            default:
                throw new ArgumentOutOfRangeException();

            case VariableType.Unknown:
                break;
            }
        }