public void SetAlignment(mobAffiliation affil = mobAffiliation.NonThreat) { iff = affil; if (iff == mobAffiliation.Ally) { gameObject.tag = "Ally"; EngineChange(ScoreKeeper.allyColor); } if (iff == mobAffiliation.NonThreat) { gameObject.tag = "NonThreat"; // EngineChange(ScoreKeeper.allyColor); } if (iff == mobAffiliation.Threat) { gameObject.tag = "NonThreat"; EngineChange(ScoreKeeper.threatColor); } //NonThreat = 0, //Harmless: 0s //Ally = 10, //allies 10s //Threat = 20, // threat 20s textureChangeOnTag viles = transform.GetComponentInChildren <textureChangeOnTag>(); if (viles != null) { viles.TextureChange(gameObject.GetComponent <EnemyShipModular>()); } }
public void ColorChange(Color newColor) { textureChangeOnTag viles = transform.GetComponentInChildren <textureChangeOnTag>(); if (viles != null) { //viles.TextureChange(gameObject.GetComponent<EnemyShipModular>()); } for (int i = 0; i < engines.Length; i++) { ParticleSystem[] engineFlares = engines[i].transform.GetComponentsInChildren <ParticleSystem>(); { for (int ii = 0; ii < engineFlares.Length; ii++) { ParticleSystem.MainModule flareMain = engineFlares[ii].main; flareMain.startColor = newColor; } } } }