Example #1
0
        public void Update(object value)
        {
            switch ((DataType)this.type)
            {
            case DataType.String: this.varStr = new VariableStr((string)value); break;

            case DataType.Number: this.varNum = new VariableNum((float)value); break;

            case DataType.Bool: this.varBol = new VariableBol((bool)value); break;

            case DataType.Color: this.varCol = new VariableCol((Color)value); break;

            case DataType.Vector2: this.varVc2 = new VariableVc2((Vector2)value); break;

            case DataType.Vector3: this.varVc3 = new VariableVc3((Vector3)value); break;

            case DataType.Texture2D: this.varTxt = new VariableTxt((Texture2D)value); break;

            case DataType.Sprite: this.varSpr = new VariableSpr((Sprite)value); break;

            case DataType.GameObject: this.varObj = new VariableObj((GameObject)value); break;

            case DataType.Transform: this.varTrn = new VariableTrn((Transform)value); break;

            case DataType.Rigidbody: this.varRbd = new VariableRbd((Rigidbody)value); break;
            }
        }
Example #2
0
        public Variable(Variable variable)
        {
            this.name = variable.name;
            this.type = variable.type;
            this.save = variable.save;

            this.varStr = variable.varStr;
            this.varNum = variable.varNum;
            this.varBol = variable.varBol;
            this.varCol = variable.varCol;
            this.varVc2 = variable.varVc2;
            this.varVc3 = variable.varVc3;
            this.varTxt = variable.varTxt;
            this.varSpr = variable.varSpr;
            this.varObj = variable.varObj;
        }
Example #3
0
        public Variable(Variable variable)
        {
            this.name = variable.name;
            this.type = variable.type;
            this.save = variable.save;

            this.varStr = new VariableStr(variable.varStr.Get());
            this.varNum = new VariableNum(variable.varNum.Get());
            this.varBol = new VariableBol(variable.varBol.Get());
            this.varCol = new VariableCol(variable.varCol.Get());
            this.varVc2 = new VariableVc2(variable.varVc2.Get());
            this.varVc3 = new VariableVc3(variable.varVc3.Get());
            this.varTxt = new VariableTxt(variable.varTxt.Get());
            this.varSpr = new VariableSpr(variable.varSpr.Get());
            this.varObj = new VariableObj(variable.varObj.Get());
        }