public void SetVamparasite() { // Don't activate vamparasite more than once if (isVamparasite) { return; } isVamparasite = true; try { Parasite parasite = (Parasite)owner.GetCharacter(); if (parasite != null) { parasite.ChangeToVampColour(); } } catch {} GameObject mutationAlertPrefab = Resources.Load("MutationAlert") as GameObject; GameObject.Instantiate(mutationAlertPrefab, owner.GetCharacter().transform.position + (Vector3)HEALTH_ALERT_OFFSET, Quaternion.identity); UiManager.Instance.ActivateMutation(0); }
public void PhysicsUpdate() { // Update all characters in the scene // OPTIMIZE: (maybe by going through the cached players and calling PhysicsUpdate for them?) // Note: when caching characters, account for new characters spawning (e.g. parasite disinfect) foreach (Character character in GameObject.FindObjectsOfType <Character>()) { character.PhysicsUpdate(); } Vector2 characterPosition = characterSpawner.GetCharacter().transform.position; foreach (TriggerZone zone in triggerZones) { zone.OnUpdate(characterPosition); } }