Example #1
0
 void onCollectablePickup(CollectablePickedupEvent collectablePickedupEvent)
 {
     if (collectablePickedupEvent.Collectable is FinalItem)
     {
         isLevelCompleted = true;
     }
 }
Example #2
0
 // Start is called before the first frame update
 void Start()
 {
     mainCamera     = Camera.main;
     uiCanvas       = FindObjectOfType <Canvas>().gameObject.transform;
     scoreIndicator = FindObjectOfType <ScoreIndicator>();
     CollectablePickedupEvent.AddListener(onCollectablePickedup);
 }
Example #3
0
 void onCollectablePickedup(CollectablePickedupEvent collectablePickedup)
 {
     if (collectablePickedup.Collectable is SprayItem)
     {
         Destroy(gameObject);
     }
 }
 void onCollectablePickedup(CollectablePickedupEvent collectablePickedup)
 {
     AudioSourceManager.PlayAudioOneShot(collectableSFX.GetAudioClip(),
                                         collectableSFX.GetVolume(),
                                         collectableSFX.GetPitch(),
                                         collectableSFX.GetSpatialBlend());
 }
    // Start is called before the first frame update
    void Start()
    {
        language = LanguageLocator.GetLanguage();
        CollectablePickedupEvent.AddListener(onCollectablePickedup);
        string StartDialogue = language.GetDialogueText(DialogueText.DIALOGUE_TYPE.START);

        EventManager.Queue(new ShowDialogueEvent(StartDialogue));
    }
 private void OnDestroy()
 {
     AlarmTriggered.ClearListeners();
     CameraTriggered.ClearListeners();
     CollectablePickedupEvent.ClearListeners();
     GameOverEvent.ClearListeners();
     AlarmStateChanged.ClearListeners();
     ShowDialogueEvent.ClearListeners();
 }
 void onCollectablePickedup(CollectablePickedupEvent collectablePickedup)
 {
     if (collectablePickedup.Collectable is SprayItem)
     {
         string SprayDialogue = language.GetDialogueText(DialogueText.DIALOGUE_TYPE.SPRAY);
         EventManager.Queue(new ShowDialogueEvent(SprayDialogue));
     }
     if (collectablePickedup.Collectable is FinalItem)
     {
         string EndDialogue = language.GetDialogueText(DialogueText.DIALOGUE_TYPE.YARN);
         EventManager.Queue(new ShowDialogueEvent(EndDialogue));
     }
 }
Example #8
0
    void onCollectablePickedup(CollectablePickedupEvent collectablePickedup)
    {
        CollectableItems.Collectable collectable = collectablePickedup.Collectable;

        if (collectable.GetItemValue() > 0)
        {
            TextMovementAnimation textMovement = GetUnusedText();
            textMovement.StartPosition = mainCamera.WorldToScreenPoint(collectable.GetCollectablePosition() + Vector3.up);
            textMovement.EndPosition   = scoreIndicator.transform.position + Offset;
            textMovement.SetScoreText(string.Format("+ {0}", collectable.GetItemValue()));
            textMovement.PlayAnimation();
        }
    }
Example #9
0
 // Start is called before the first frame update
 void Start()
 {
     CollectablePickedupEvent.AddListener(onCollectablePickup);
 }
Example #10
0
 private void OnDestroy()
 {
     CollectablePickedupEvent.RemoveListener(onCollectablePickup);
 }
 // Start is called before the first frame update
 void Start()
 {
     collectableSFX = FindObjectOfType <SoundEffectManager>().GetSoundEffect(GeneralVariables.SFX.COLLECTABLE);
     CollectablePickedupEvent.AddListener(onCollectablePickedup);
 }
 void onCollectablePickedup(CollectablePickedupEvent collectablePickedup)
 {
     currentScore += collectablePickedup.Collectable.GetItemValue();
     OnScoreChanged(currentScore);
 }
 // Start is called before the first frame update
 void Start()
 {
     CollectablePickedupEvent.AddListener(onCollectablePickedup);
     ResolutionScreenSetup.OnLoadCheckpoint += onLoadCheckpoint;
 }