void Update() { //TODO: Lerp color if (rend.material.color != LayerColors.FindLayerColor(gameObject.layer)) { rend.material.color = Color.Lerp(rend.material.color, LayerColors.FindLayerColor(gameObject.layer), 0.1f); } }
public void AddLayer(string name, Color color) { LayerNames.Add(name); LayerColors.Add(color); var result = Count - 1; CurrentLayer = result; VisibleIndices[result] = true; }
// Use this for initialization void Start() { cubeSource = GetComponent <AudioSource>(); fallingSource = GetComponent <AudioSource>(); cubeRadius = transform.lossyScale.x * 0.5f; pivot = new GameObject("Pivot"); pivot.transform.SetParent(transform); rend = gameObject.GetComponent <Renderer> (); if (GameManager.instance.CustomSpawn()) { rend.material.color = LayerColors.FindLayerColor(gameObject.layer); } else { rend.material.color = LayerColors.defaultColor; } //Set the first spawnpoint to the inital location of the player prefab (as set in scene editor) GameManager.instance.SetSpawn(transform.position); AlignPosition(); }
public void RemoveLayer(int layerIndex, Document document) { if (layerIndex < CurrentLayer) { CurrentLayer--; } var children = new List <Node>(document.Root.Children.Values); foreach (var child in children) { var interpreter = child.Set <LayerVisibilityInterpreter>(); if (interpreter.TagIndex == layerIndex) { DeleteNode(child, document); } if (interpreter.TagIndex > layerIndex) { interpreter.TagIndex--; } } LayerNames.RemoveAt(layerIndex); LayerColors.RemoveAt(layerIndex); }