Exemple #1
0
 private void OnDisable()
 {
     if (currentBloodStreak != null)
     {
         currentBloodStreak.Detach();
         currentBloodStreak = null;
     }
 }
Exemple #2
0
    private void CreateBloodStreak(Vector2 position)
    {
        if (currentBloodStreak != null)
        {
            currentBloodStreak.Detach();
        }
        GameObject streakGo = Instantiate(bloodStreakPrefab, position, Quaternion.identity);

        currentBloodStreak = streakGo.GetComponent <BloodStreak>();
        currentBloodStreak.AddLocation(position);
    }
Exemple #3
0
 private void OnCollisionExit2D(Collision2D collision)
 {
     if (!enabled)
     {
         return;
     }
     if (currentBloodStreak != null && collision.gameObject.layer != LayerMask.NameToLayer("Player"))
     {
         currentBloodStreak.Detach();
         currentBloodStreak = null;
     }
 }