public void StartRepair() { repairingBox.DOScale(1, .2f).OnComplete(() => CorrectButtonManager.Get().isPlaying = true); currentSpot.isRepairing = true; charaController.lockControl = true; SelectLevel(currentSpot); StartCoroutine(GenerateRepairSequence()); }
public static CorrectButtonManager Get() { if (_thisInstance == null) { GameObject newGameObject = new GameObject("CorrectButtonManager"); _thisInstance = newGameObject.AddComponent <CorrectButtonManager>(); } return(_thisInstance); }
void Awake() { if (_thisInstance == null) { _thisInstance = this; } else { Destroy(this); } }
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(); } }
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); } }
private void Start() { CorrectButtonManager.Get().onCorrectButtonDelegate += ButtonCorrect; }