示例#1
0
 public void StartRepair()
 {
     repairingBox.DOScale(1, .2f).OnComplete(() => CorrectButtonManager.Get().isPlaying = true);
     currentSpot.isRepairing     = true;
     charaController.lockControl = true;
     SelectLevel(currentSpot);
     StartCoroutine(GenerateRepairSequence());
 }
示例#2
0
    public static CorrectButtonManager Get()
    {
        if (_thisInstance == null)
        {
            GameObject newGameObject = new GameObject("CorrectButtonManager");
            _thisInstance = newGameObject.AddComponent <CorrectButtonManager>();
        }

        return(_thisInstance);
    }
示例#3
0
 void Awake()
 {
     if (_thisInstance == null)
     {
         _thisInstance = this;
     }
     else
     {
         Destroy(this);
     }
 }
示例#4
0
 private void Update()
 {
     if (!isEntered)
     {
         if (rect.localPosition.x >= 142 && rect.localPosition.x <= 165)
         {
             CorrectButtonManager.Get().OnButtonEnter(this);
             isEntered = true;
         }
     }
     else if (rect.localPosition.x > 167)
     {
         CorrectButtonManager.Get().OnButtonExit();
     }
 }
示例#5
0
    public void StopRepair()
    {
        repairingBox.DOScale(0, .2f);
        if (currentSpot != null)
        {
            currentSpot.GetComponent <BoxCollider2D>().isTrigger = false;
            currentSpot.GetComponent <BoxCollider2D>().isTrigger = true;
        }

        CorrectButtonManager.Get().isPlaying = false;
        charaController.lockControl = false;
        if (currentSpot != null)
        {
            currentSpot.isRepairing = false;
        }
        foreach (ButtonInfo go in FindObjectsOfType <ButtonInfo>())
        {
            Destroy(go.gameObject);
        }
    }
示例#6
0
 private void Start()
 {
     CorrectButtonManager.Get().onCorrectButtonDelegate += ButtonCorrect;
 }