void Distraction() { Chick settingTgt = bbychick.GetComponent <Chick>(); float distractDis = Vector2.Distance(chick.transform.position, transform.position); if (distractDis < 2) { settingTgt.SetTarget(transform); close = true; } }
void HideChick() { Chick settingTgt = chick.GetComponent <Chick>(); if (Input.GetButtonDown(hideButton) || Input.GetAxisRaw(hideButton) > 0) { GameManager.instance.hideTheChick = true; settingTgt.SetTarget(transform); mySpriteRenderer.sortingOrder = 2; } else if (Input.GetButtonUp(hideButton) || Input.GetAxisRaw(hideButton) <= 0) { GameManager.instance.hideTheChick = false; mySpriteRenderer.sortingOrder = 0; } }
void HideChick() { if (!GameManager.instance.restartingFromLastCheckpoint) { Chick settingTgt = chick.GetComponent <Chick>(); if (Input.GetButtonDown(hideButton) || Input.GetAxisRaw(hideButton) > 0) { GameManager.instance.hideTheChick = true; settingTgt.SetTarget(transform); } else if (Input.GetButtonUp(hideButton) || Input.GetAxisRaw(hideButton) <= 0) { GameManager.instance.hideTheChick = false; } } }