private void OnTriggerEnter2D(Collider2D collision) { Debug.Log("AbilityCollider OnTriggerEnter2D collision.tag " + collision.tag + " casterTeamName" + abilityData.description.casterTeamName); // Check if we've hit the player if (collision.tag.Contains("Team")) { Debug.Log("AbilityCollider OnTriggerEnter2D collided with player"); HandlePlayerCollision(collision); } // We hit an ice wall so apply some damage else if (collision.tag == "Ice Wall") { Debug.Log("We hit the ice wall"); HandleIceWallCollision(collision); } // We hit a wall, just deactivate the projectile // We also want the traps to not interact with the wall else if (collision.tag == "Wall" && !isStatic) { Debug.Log("Collided with wall"); projectileVisuals.Deactivate(); } else { HandleElementalCollisions(collision); } }
IEnumerator Disable() { yield return(new WaitForSeconds(duration)); Debug.Log("Flicker Disable"); projectileVisuals.Deactivate(); }
void InitPool(GameObject template, int size) { ProjectileVisuals[] pool = new ProjectileVisuals[size]; for (int i = 0; i < size; i++) { GameObject go = Instantiate(template, transform); go.name = template.name; ProjectileVisuals visuals = go.GetComponent <ProjectileVisuals>(); pool[i] = visuals; visuals.Deactivate(); } // We will set the config value for the object type we just created to 0 so that we can use this Dictionary to store the current index poolConfig[template.name] = 0; poolMap.Add(template.name, pool); }
void Deactivate() { visuals.Deactivate(); }
public void Destroy() { visuals.Deactivate(); }