All Classes Namespaces Functions Variables Enumerations Enumerator Properties
plyGame.SimpleCustomizer Class Reference

This component makes it easier to manipulate the used material, colour and the enabled objects of a parent object. Useful for simple character customization. More...

Inherits MonoBehaviour.

Public Member Functions

void UseSettings (List< Settings > s)
 You need to call this with the data from the prefab's settings if calls where made on the prefab's ChangeObject, ChangeMaterial, etc More...
 
List< Settings > GetSettings ()
 Return the settings of this customizer. Settings tells what objects, material, etc should be applied. It records the calls to ChangeObject, ChangeMaterial, etc to create these settings More...
 
int GetMaterialGroup (string name)
 Return the index of the given group name. -1 if not found. More...
 
int GetTextureGroup (string name)
 Return the index of the given group name. -1 if not found. More...
 
int GetColorGroup (string name)
 Return the index of the given group name. -1 if not found. More...
 
int GetObjectGroup (string name)
 Return the index of the given group name. -1 if not found. More...
 
bool ChangeObject (int group, int idx)
 Change to one at idx to be active in the given group. More...
 
bool ChangeMaterial (int group, int idx)
 Change to one at idx to be active in the given group. More...
 
bool ChangeTexture (int group, int idx)
 Change to one at idx to be active in the given group. More...
 
bool ChangeColor (int group, int idx)
 Change to one at idx to be active in the given group. More...
 

Public Attributes

List< SimpleCustomizer_Materials > matGroups = new List<SimpleCustomizer_Materials>()
 List of Material groups More...
 
List< SimpleCustomizer_Colors > colGroups = new List<SimpleCustomizer_Colors>()
 List of Colour groups More...
 
List< SimpleCustomizer_Textures > texGroups = new List<SimpleCustomizer_Textures>()
 List of Texture groups More...
 
List
< SimpleCustomizer_ObjectGroup > 
objGroups = new List<SimpleCustomizer_ObjectGroup>()
 List of Object groups More...
 

Protected Member Functions

void Awake ()
 
void Start ()
 

Detailed Description

This component makes it easier to manipulate the used material, colour and the enabled objects of a parent object. Useful for simple character customization.

For materials, colours and textures the group name should start with the same name as the objects that should be affected. So if you wanted to change the Face of a character by changing the materials on an object named FaceArt then you could name the group "Face" or "FaceArt".

The objects group work different and will simply disable all objects in the same group except for the one you set to be active when making a call to ChangeObject.

Member Function Documentation

bool plyGame.SimpleCustomizer.ChangeColor ( int  group,
int  idx 
)

Change to one at idx to be active in the given group.

bool plyGame.SimpleCustomizer.ChangeMaterial ( int  group,
int  idx 
)

Change to one at idx to be active in the given group.

bool plyGame.SimpleCustomizer.ChangeObject ( int  group,
int  idx 
)

Change to one at idx to be active in the given group.

bool plyGame.SimpleCustomizer.ChangeTexture ( int  group,
int  idx 
)

Change to one at idx to be active in the given group.

int plyGame.SimpleCustomizer.GetColorGroup ( string  name)

Return the index of the given group name. -1 if not found.

int plyGame.SimpleCustomizer.GetMaterialGroup ( string  name)

Return the index of the given group name. -1 if not found.

int plyGame.SimpleCustomizer.GetObjectGroup ( string  name)

Return the index of the given group name. -1 if not found.

List<Settings> plyGame.SimpleCustomizer.GetSettings ( )

Return the settings of this customizer. Settings tells what objects, material, etc should be applied. It records the calls to ChangeObject, ChangeMaterial, etc to create these settings

int plyGame.SimpleCustomizer.GetTextureGroup ( string  name)

Return the index of the given group name. -1 if not found.

void plyGame.SimpleCustomizer.UseSettings ( List< Settings >  s)

You need to call this with the data from the prefab's settings if calls where made on the prefab's ChangeObject, ChangeMaterial, etc

Member Data Documentation

List<SimpleCustomizer_Colors> plyGame.SimpleCustomizer.colGroups = new List<SimpleCustomizer_Colors>()

List of Colour groups

List<SimpleCustomizer_Materials> plyGame.SimpleCustomizer.matGroups = new List<SimpleCustomizer_Materials>()

List of Material groups

List<SimpleCustomizer_ObjectGroup> plyGame.SimpleCustomizer.objGroups = new List<SimpleCustomizer_ObjectGroup>()

List of Object groups

List<SimpleCustomizer_Textures> plyGame.SimpleCustomizer.texGroups = new List<SimpleCustomizer_Textures>()

List of Texture groups