void playerCollidingManagement() { if (!PlayStatusTracker.inPlay) { return; } if (((oneTimeInteraction && !interacted) || !oneTimeInteraction)) { //mostra la E setIndicationVisible(playerColliding); //indication.SetActive(playerColliding); //Debug.Log (gameObject.name +" "+ (inputKeeper!= null && inputKeeper.isButtonUp("Interaction") && ((oneTimeInteraction && !interacted) || !oneTimeInteraction) && playerColliding)); //Debug.Log (gameObject.name +" "+ (((oneTimeInteraction && !interacted) || !oneTimeInteraction) && playerColliding)); //scorre l'array di gameObject e chiama il metodo if (((oneTimeInteraction && !interacted) || !oneTimeInteraction) && playerColliding) { if (inputKeeper != null && inputKeeper.isButtonDown("Interaction")) { //Debug.Log ("inviato messaggio di interazione ad oggetto "); if (audioHandler != null) { //Debug.Log ("i'm in"); audioHandler.playClipByName("Leva"); } interacted = true; for (int i = 0; i < objectsWithMethods.Length; i++) { if (objectsWithMethods[i] != null) { if (activeDisabledObject) { objectsWithMethods[i].SetActive(true); } objectsWithMethods[i].SendMessage(methodToCall, SendMessageOptions.DontRequireReceiver); //Debug.Log ("inviato messaggio di interazione ad oggetto "+objectsWithMethods[i].name); } } //gestione leva Lever leverScript = GetComponent <Lever>(); if (leverScript != null) { leverScript.InteractingMethod(); } //indication.SetActive(false); setIndicationVisible(false); } } } }