예제 #1
0
 void Start()
 {
     keyEntity.IsDestroy = false;
     keyEntity.onUse    += () =>
     {
         if (!isEnabled)
         {
             return;
         }
         AudioManager.Instance.PlaySound("Unlock");
         keyEntity.gameObject.SetActive(false);
         transform.DOShakeScale(0.2f, 0.1f).OnComplete(() =>
         {
             transform.DOLocalMoveY(transform.localPosition.y - 0.4f, fallTime).
             SetDelay(0.4f).OnStart(() => GetComponent <SpriteRenderer>().DOFade(0, fallTime - 0.05f));
             starLock.Complete();
             isLocked = false;
             if (!another.isLocked && !this.isLocked)
             {
                 controller.CompleteLevel();
             }
         });
     };
     keyEntity.onBeginDrag += starKey.Complete;
 }
예제 #2
0
    void Start()
    {
        for (int i = 0; i < ashes.Length; i++)
        {
            ashes[i].onStewing += () =>
            {
                if (IsAllFlamesStewed())
                {
                    controller.CompleteLevel();
                }
            }
        }
        ;
    }

    bool IsAllFlamesStewed()
    {
        for (int i = 0; i < ashes.Length; i++)
        {
            if (!ashes[i].IsStewed)
            {
                return(false);
            }
        }
        return(true);
    }
}
예제 #3
0
 private void Complete()
 {
     for (int i = 0; i < buttons.Length; i++)
     {
         buttons[i].HideButton();
     }
     for (int i = 0; i < cells.Length; i++)
     {
         cells[i].HideCell();
     }
     controller.CompleteLevel();
 }
예제 #4
0
 public void Valid()
 {
     transform.DOShakeScale(0.2f, 0.1f).SetDelay(1).OnStart(() => AudioManager.Instance.PlaySound("Unlock")).OnComplete(() =>
     {
         for (int i = 0; i < goblets.Length; i++)
         {
             goblets[i].HideGoblet();
         }
         ball.GetComponent <SpriteRenderer>().DOFade(0, 0.8f);
         controller.CompleteLevel();
     });
 }
예제 #5
0
 void LevelComplete()
 {
     for (int i = 0; i < gems.Length; i++)
     {
         if (!gems[i].IsDeployed)
         {
             seive.MoveSieveDown();
             buckets.EndSeiving();
             return;
         }
     }
     controller.CompleteLevel();
 }