Exemplo n.º 1
0
    private void Awake()
    {
        DiodeManager.RegisterDiodeController(this, diodeID);

        //Create dictionaries
        minColors = new Dictionary <MeshRenderer, Color>();
        maxColors = new Dictionary <MeshRenderer, Color>();
        lerpSpeed = new Dictionary <MeshRenderer, float>();

        //Create material instances
        foreach (MeshRenderer d in diodeList)
        {
            d.sharedMaterial = new Material(d.sharedMaterial);
            d.sharedMaterial.DisableKeyword("_EMISSION");
            Color currentColor = d.sharedMaterial.GetColor("_EmissionColor");
            Color minColor     = new Color(currentColor.r, currentColor.g, currentColor.b - (Random.Range(blueRandomness, blueRandomness * 2f)), 1f);
            Color maxColor     = new Color(currentColor.r - (Random.Range(redRandomness, redRandomness * 2f)), currentColor.g, currentColor.b, 1f);
            minColors[d] = minColor;
            maxColors[d] = maxColor;
            lerpSpeed[d] = Random.Range(minColorLerpSpeed, maxColorLerpSpeed);
        }

        if (startOnAwake)
        {
            Activate();
        }
    }
Exemplo n.º 2
0
 private void Awake()
 {
     lr = GetComponent <LineRenderer>();
     if (emissiveBoost != 1f)
     {
         lr.sharedMaterial = new Material(lr.sharedMaterial);
         lr.sharedMaterial.SetColor("_EmissionColor", lr.sharedMaterial.GetColor("_EmissionColor") * emissiveBoost);
     }
     DiodeManager.RegisterNeonController(this, diodeID);
     endPosition = lr.GetPosition(1);
     lr.SetPosition(1, Vector3.zero);
     if (startOnAwake)
     {
         Activate();
     }
 }
Exemplo n.º 3
0
 public void ActivateDiodeByID(int ID)
 {
     DiodeManager.ActivateDiodes(ID);
 }
Exemplo n.º 4
0
 public void ActivateNeonByID(int ID)
 {
     DiodeManager.ActivateNeons(ID);
 }