diff options
author | Jose Antonio Marquez | 2012-03-22 16:26:02 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-03-22 16:26:02 -0700 |
commit | 748a5c55e15809add748a15a87cd730e3fcee4bf (patch) | |
tree | 688f3ee299b2985fa5617426a5789d86f518b877 /js/lib/rdge/materials/twist-vert-material.js | |
parent | 7fbda862c62f37d4c67e4d5a619b7e3cffc309ff (diff) | |
parent | b25195d010417417bb5b2e5362385078d68d9a84 (diff) | |
download | ninja-748a5c55e15809add748a15a87cd730e3fcee4bf.tar.gz |
Merge branch 'refs/heads/Ninja-Montage-Integration' into FileIO-Montage-Components
Diffstat (limited to 'js/lib/rdge/materials/twist-vert-material.js')
-rw-r--r-- | js/lib/rdge/materials/twist-vert-material.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/js/lib/rdge/materials/twist-vert-material.js b/js/lib/rdge/materials/twist-vert-material.js index 05172a1b..2d2cdcc5 100644 --- a/js/lib/rdge/materials/twist-vert-material.js +++ b/js/lib/rdge/materials/twist-vert-material.js | |||
@@ -102,6 +102,34 @@ function TwistVertMaterial() | |||
102 | } | 102 | } |
103 | /////////////////////////////////////////////////////////////////////// | 103 | /////////////////////////////////////////////////////////////////////// |
104 | 104 | ||
105 | this.exportJSON = function() | ||
106 | { | ||
107 | var jObj = | ||
108 | { | ||
109 | 'material' : this.getShaderName(), | ||
110 | 'name' : this.getName(), | ||
111 | 'color' : this._propValues["color"] | ||
112 | }; | ||
113 | |||
114 | return jObj; | ||
115 | } | ||
116 | |||
117 | this.importJSON = function( jObj ) | ||
118 | { | ||
119 | if (this.getShaderName() != jObj.material) throw new Error( "ill-formed material" ); | ||
120 | this.setName( jObj.name ); | ||
121 | |||
122 | try | ||
123 | { | ||
124 | var color = jObj.color; | ||
125 | this.setProperty( "color", color); | ||
126 | } | ||
127 | catch (e) | ||
128 | { | ||
129 | throw new Error( "could not import material: " + importStr ); | ||
130 | } | ||
131 | } | ||
132 | |||
105 | this.export = function() | 133 | this.export = function() |
106 | { | 134 | { |
107 | // this function should be overridden by subclasses | 135 | // this function should be overridden by subclasses |