using UnityEngine using System Collections using System Collections Ge

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Settings : MonoBehaviour {
public Light Spot;
public Light Ambi;
public GameObject Mesh;
public ParticleSystem Sparks;
public int speed=10;
bool anim=true;
public bool optimization =true;
int skin = 0;
public List <float> Shine = new List<float>();
public List<Color> MeshColor = new List<Color>();
public List<Color> SpecColor = new List<Color>();
public List<Color> AmbiColors = new List<Color>();
public List<Color> SpotColors = new List<Color>();
public List<Material> SparksColorsStart = new List<Material>();
// Use this for initialization
void Start()
{
Skin(skin);
Animation(anim);
Optimization(optimization);
}
void Animation(bool anim)
{
if (anim)
{
Mesh.animation.Play("KamenAnim", PlayMode.StopAll);
} else {
Mesh.animation.Play("KamenAnimOff", PlayMode.StopAll);
}
}
void CheckAnimation(string b)
{
anim = bool.Parse(b);
Animation(anim);
}
void CheckSkin(string a) {
skin = int.Parse(a);
Skin(skin);
}
void CheckOptimization(string a)
{
optimization = bool.Parse(a);
Optimization(optimization);
}
void Optimization(bool optimization)
{
if (optimization) { Mesh.renderer.material.shader=Shader.Find("Mobile/Bumped Specular"); }
else { Mesh.renderer.material.shader = Shader.Find("Bumped Specular"); }
}
void Skin(int skin)
{
Spot.color = SpotColors[skin];
Ambi.color = AmbiColors[skin];
Mesh.renderer.material.SetFloat("_Shiness",Shine[skin]);
Mesh.renderer.material.color=MeshColor[skin];
Mesh.renderer.material.SetColor("_SpecColor",SpecColor[skin]);
Sparks.renderer.material = SparksColorsStart[skin];
}
}