void OnTriggerEnter2D(Collider2D other) { if (flagScript) { return; } if (other.gameObject.tag == objectTag) { ScriptSystem scriptSystem = ScriptSystem.GetInstance(); scriptSystem.SetScriptCommand(doingObject, scriptCommand, arrayOfParameter); flagScript = true; Destroy(gameObject); } }
void OnTriggerStay2D(Collider2D other) { if (gameObject.activeSelf) { if (other.gameObject.tag == objectTag) { objectRenderer.enabled = true; if (Input.GetKeyUp(keyKode)) { ScriptSystem scriptSystem = ScriptSystem.GetInstance(); scriptSystem.SetScriptCommand(doingObject, scriptCommand, arrayOfParameter); if (isLimited) { gameObject.SetActive(false); Destroy(gameObject); Debug.Log("KetCondition: OK!!!"); } } } } }