void FixedUpdate() { if (countingDown) { if (timeTillDamage_seconds <= 0) { if (damageAnimationPrefab != null) //play damage animation { Instantiate(damageAnimationPrefab, transform.position, new Quaternion()); countingDown = false; animationRuning = true; SpriteRenderer sr = GetComponent <SpriteRenderer>(); if (sr != null) { sr.sprite = null; } } } else { timeTillDamage_seconds -= Time.fixedDeltaTime; } } else if (animationRuning) { timeTillDamagePointInDamageAnimation_seconds -= Time.fixedDeltaTime; if (timeTillDamagePointInDamageAnimation_seconds <= 0) { damageActors(); UnityExtentionMethods.destoryAllChildren(transform); } } }
private void actorDies() { UnityExtentionMethods.destoryAllChildren(transform); dead = true; //TAG: level analytics if (team != DamageSources.player1) { LevelAnalytics.Instance.enemyDestroyed(); } }
// Update is called once per frame void Update() { if (objectFollowing != null) { transform.position = objectFollowing.position; } else { UnityExtentionMethods.destoryAllChildren(transform); } }
private void Awake() { //WARNING this assumes PauseGameWorld transform is parented to a canvas if (PauseMenuHandler.Instance.pauseMenuExists()) { Debug.LogWarning("Pause menu already exists! \n destroying this one"); UnityExtentionMethods.destoryAllChildren(transform.parent); return; } PauseMenuHandler.Instance.setPauseMenu(transform.parent.gameObject); }
private void InitCardSelector() { for (int i = 0; i < transform.childCount; i++) { UnityExtentionMethods.destoryAllChildren(transform.GetChild(i)); } IEnumerable <Card> allCards = ReflectiveEnumerator.GetEnumerableOfType <Card>(); foreach (Card card in allCards) { //card base classes with this class name are not real cards and should be ignored if (card.GetType().Name.Contains("Base_")) { continue; } Instantiate(cardDisplayPrefab, transform).GetComponent <CardDisplayController>().setCardDisplay(card, deckList); } }
// Update is called once per frame void Update() { if (running) { if (spriteStateChangeTimer_seconds <= 0) { sr.enabled = !sr.enabled; spriteStateChangeTimer_seconds = flashRate_seconds; } else { spriteStateChangeTimer_seconds -= Time.deltaTime; } flashingLength_seconds -= Time.deltaTime; if (flashingLength_seconds <= 0) { running = false; if (destoryWhenDone) { UnityExtentionMethods.destoryAllChildren(transform); } } } }
public void clearDeck() { foreach(CardDisplayController cardDisplayer in listOfCards) { UnityExtentionMethods.destoryAllChildren(cardDisplayer.transform); } listOfCards.Clear(); }
public void removeCardFromDeck(CardDisplayController cardDisplay) { listOfCards.Remove(cardDisplay); UnityExtentionMethods.destoryAllChildren(cardDisplay.transform); }
private void Start() { for(int i = 0; i < cardListDisplay.childCount; i++) { UnityExtentionMethods.destoryAllChildren(cardListDisplay.GetChild(i)); } }
public void destroyAreas() { UnityExtentionMethods.destoryAllChildren(transform); }
/// <summary> /// destroys the projectile along with it's children /// </summary> protected void destroyProjectile() { UnityExtentionMethods.destoryAllChildren(transform); }