public void OnTriggerEnter(Collider other) { if (other.CompareTag("Computer")) { OnComputerGoal.Invoke(other.GetComponent <Computer>()); } }
//When we are told a goal is scored... public void GoalScored() { //increase the score value by 1 score++; //tell everyone else that a goal was scored. OnGoalScored.Invoke(score); }
public void failGoal(QuestsList list) { if (goalState != QUEST_STATE.ACTIVE) { return; } goalState = QUEST_STATE.FAILED; onGoalFail.Invoke(this); list.invokeGoalGlobalEvent(this, goalState); }
void OnTriggerEnter2D(Collider2D collider) { if (collider.gameObject.GetComponent <Disc>() == null) { return; } if (audioEnabled) { audioSource.Play(); } OnGoalEvent.Invoke(transform.localPosition.x > 0 ? PlayerID.Left : PlayerID.Right); }
public void completeGoal(QuestsList list) { if (goalState != QUEST_STATE.ACTIVE) { return; } goalState = QUEST_STATE.COMPLETE; if (goalCondition) { goalCondition.isSatisfied = true; } onGoalComplete.Invoke(this); list.invokeGoalGlobalEvent(this, goalState); }
private void OnTriggerExit(Collider other) { if (other.CompareTag("Goal") && !goalMet) { rb.useGravity = false; rb.drag = 1f; rb.angularDrag = 1f; StartCoroutine(FlyAway()); goalMet = true; GoalEvent?.Invoke(); } if (other.CompareTag("Falloff") && goalMet == false && !isFallOut) { GameManager.Instance.ManageFalloff(); PlayerFalloutEvent?.Invoke(); isFallOut = true; } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag(tagToCompare)) { score.Earn(); // Invoke the event if (earnEvent != null) { earnEvent(score.GetScore, team); } if (goalEvent != null) { goalEvent.Invoke(other.gameObject); } #if UNITY_EDITOR_64 || UNITY_EDITOR Debug.LogWarningFormat("Score: {0}", score.GetScore); #endif } }
private void ComputerGoalReached(Computer computer) { Debug.Log(computer.PieceContainers.Count + " : " + computer.name); OnComputerGoal.Invoke(computer); Destroy(computer.gameObject); }
private void onGoalCompletedRaised(Goal goal) { onGoalComplete.Invoke(goal); //Debug.Log("onGoalCompletedRaised: " + goal.goalName); }
private void onGoalFailedRaised(Goal goal) { onGoalFail.Invoke(goal); //Debug.Log("onGoalFailedRaised: " + goal.goalName); }