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

            goalState = QUEST_STATE.FAILED;
            onGoalFail.Invoke(this);
            list.invokeGoalGlobalEvent(this, goalState);
        }
예제 #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);
 }
예제 #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);
        }
예제 #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;
        }
    }
예제 #7
0
파일: Goal.cs 프로젝트: psuong/cubeball
    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
        }
    }
예제 #8
0
 private void ComputerGoalReached(Computer computer)
 {
     Debug.Log(computer.PieceContainers.Count + " : " + computer.name);
     OnComputerGoal.Invoke(computer);
     Destroy(computer.gameObject);
 }
예제 #9
0
 private void onGoalCompletedRaised(Goal goal)
 {
     onGoalComplete.Invoke(goal);
     //Debug.Log("onGoalCompletedRaised: " + goal.goalName);
 }
예제 #10
0
 private void onGoalFailedRaised(Goal goal)
 {
     onGoalFail.Invoke(goal);
     //Debug.Log("onGoalFailedRaised: " + goal.goalName);
 }