Exemplo n.º 1
0
 public void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Computer"))
     {
         OnComputerGoal.Invoke(other.GetComponent <Computer>());
     }
 }
Exemplo n.º 2
0
    //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);
    }
Exemplo n.º 3
0
        public void failGoal(QuestsList list)
        {
            if (goalState != QUEST_STATE.ACTIVE)
            {
                return;
            }

            goalState = QUEST_STATE.FAILED;
            onGoalFail.Invoke(this);
            list.invokeGoalGlobalEvent(this, goalState);
        }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
    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;
        }
    }
Exemplo n.º 7
0
    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
        }
    }
Exemplo n.º 8
0
 private void ComputerGoalReached(Computer computer)
 {
     Debug.Log(computer.PieceContainers.Count + " : " + computer.name);
     OnComputerGoal.Invoke(computer);
     Destroy(computer.gameObject);
 }
Exemplo n.º 9
0
 private void onGoalCompletedRaised(Goal goal)
 {
     onGoalComplete.Invoke(goal);
     //Debug.Log("onGoalCompletedRaised: " + goal.goalName);
 }
Exemplo n.º 10
0
 private void onGoalFailedRaised(Goal goal)
 {
     onGoalFail.Invoke(goal);
     //Debug.Log("onGoalFailedRaised: " + goal.goalName);
 }