Beispiel #1
0
    private void AttemptPoop()
    {
        float poopSize = gm.AttemptPoop();

        if (poopSize != 0)
        {
            Transform p    = Instantiate(poopPrefab) as Transform;
            Poop      poop = p.GetComponent <Poop>();
            poop.SpawnPoop(new Vector3(transform.position.x, transform.position.y, transform.position.z), direction, poopSize, currentSpeed, gm);
            switch ((int)poopSize)
            {
            case 1:
            case 2:
                AudioManager.instance.PlayPoopLaunchSound(aSource, 0);
                break;

            case 3:
            case 4:
                AudioManager.instance.PlayPoopLaunchSound(aSource, 1);
                break;

            case 5:
            case 6:
                AudioManager.instance.PlayPoopLaunchSound(aSource, 2);
                break;
            }
        }
    }
Beispiel #2
0
 public Task <int> SavePoopAsync(Poop poop)
 {
     if (poop.ID != 0)
     {
         return(Database.UpdateAsync(poop));
     }
     else
     {
         return(Database.InsertAsync(poop));
     }
 }
 void Awake()
 {
     health     = FindObjectOfType <Health>();
     poopScript = FindObjectOfType <Poop>();
 }
Beispiel #4
0
 void Awake()
 {
     health     = FindObjectOfType <Health>();
     poopScript = FindObjectOfType <Poop>();
     controller = FindObjectOfType <CharacterController2D>();
 }
Beispiel #5
0
 private Task SavePoopAsync(Poop poop)
 {
     throw new NotImplementedException();
 }
Beispiel #6
0
 public Task <int> DeletePoopAsync(Poop poop)
 {
     return(Database.DeleteAsync(poop));
 }