private void PlayUnhackEffect(SystemElementController systemElementController, VirusValue virus) { if (unhackParticles != null) { unhackParticles.transform.position = systemElementController.transform.position; Gradient gradient = new Gradient(); Color startColor = systemElementController.SystemElement.OwnerVirus.Color; gradient.SetKeys( new GradientColorKey[] { new GradientColorKey(startColor, 0.0f), new GradientColorKey(Color.white, 0.3f) }, new GradientAlphaKey[] { new GradientAlphaKey(1.0f, 0.0f), new GradientAlphaKey(1.0f, 0.8f) } ); var col = hackParticles.colorOverLifetime; col.enabled = true; col.color = gradient; unhackParticles.Play(); } }
private void ElementActionHandle(SystemElementController controller, VirusValue virus) { if (gameObject.activeInHierarchy) { UpdateView(); } }
private void PlayHackEffect(SystemElementController systemElementController, VirusValue virus) { if (hackParticles != null) { hackParticles.transform.position = systemElementController.transform.position; //ParticleSystem.MinMaxGradient gradient = hackParticles.colorOverLifetime.color; //gradient.colorMin = Color.white; //gradient.colorMax = virus.Value.Color; Gradient gradient = new Gradient(); gradient.SetKeys( new GradientColorKey[] { new GradientColorKey(Color.white, 0.0f), new GradientColorKey(virus.Value.Color, 0.3f) }, new GradientAlphaKey[] { new GradientAlphaKey(1.0f, 0.0f), new GradientAlphaKey(1.0f, 0.8f) //, new GradientAlphaKey(0.0f, 1.0f) } ); var col = hackParticles.colorOverLifetime; col.enabled = true; col.color = gradient; hackParticles.Play(); } }
private void CheckOccupationLimit(SystemElementController hackedElement, VirusValue virus) { float occupation = elementList.PercentageOccupation(virus.Value); if (occupation >= OccupationLimit) { onGameOver.Invoke(); } }
public void OnElementDestroyed(SystemElementController elementController, VirusValue virus) { var element = elementController.SystemElement; var control = element.Control; int elementSize = element.Size; ElementsByControl[control].Remove(element); ControlElementSizes[control] -= elementSize; totalElementSize -= elementSize; }
private void PlayDestroyEffect(SystemElementController systemElementController, VirusValue virus) { if (destroyParticles != null) { destroyParticles.transform.position = systemElementController.transform.position; //int elementSize = systemElementController.SystemElement.Size; //destroyParticles.transform.localScale.Set(); destroyParticles.Play(); } }
private void PlayAdd(SystemElementController systemElementController, VirusValue virus) { if (hack) { bonusText.text = "+" + systemElementController.SystemElement.HackReward; } else { bonusText.text = "+" + systemElementController.SystemElement.DestroyReward; } animator.SetTrigger(addAnimationId); }
private int PlayerNumber(VirusValue player) { int i = 0; for (i = 0; i < players.Length; i++) { if (players[i] == player.Value) { return(i + 1); } } return(i); }
public OccupationCalculator(SystemElementList systemElementList, VirusValue virus) { this.systemElementList = systemElementList; this.virus = virus; var controlSizes = systemElementList.ControlElementSizes; occupationDataList = new List <OccupationData>(controlSizes.Count); foreach (var control in controlSizes) { var occupationData = new OccupationData() { Control = control.Key }; occupationDataList.Add(occupationData); } }
private void OnElementHacked(SystemElementController controller, VirusValue virus) { UpdateView(); }
private void UpdateTextElement(SystemElementController systemElementController, VirusValue virus) { UpdateText(); }
public void OnElementHacked(SystemElementController controller, VirusValue virus) { pointsPerTurn.Value += controller.SystemElement.HackReward; }
public bool IsHackedBy(VirusValue virus) { return(IsHacked && OwnerVirus == virus.Value); }
public bool IsDestroyedBy(VirusValue virus) { return(IsDestroyed && OwnerVirus == virus.Value); }