public bool CanExecuteStoryEvent(GameObject obj = null) { if (_storyEventTriggerType == TriggerType.Awake) { return(true); } if (_storyEventTriggerType == TriggerType.TriggerEnter || _storyEventTriggerType == TriggerType.TriggerExit) { if (obj == null) { return(false); } if (obj.GetComponent(StoryEventManager.GetTypeAsString(_interactionType)) == null) { return(false); } } { bool HasCompletedAll = true; foreach (StoryEventNameContainer _storyName in _eventRequiredmentList) { if (_storyName._Completed != StoryEventManager.HasStoryEventCompleted(_storyName._eventName)) { HasCompletedAll = false; break; } } if (!HasCompletedAll) { Debug.Log("has not completed all required events"); return(false); } } if (_currentInteractionCount >= _interactionCountBeforePlay + _maxInteractionCount) { return(false); } _currentInteractionCount++; if (_interactionCountBeforePlay >= _currentInteractionCount) { Debug.Log("B"); return(false); } Debug.Log("Exited the loop"); return(true); }
public void ExecuteStoryEvent() { if (_audioToPlay == null) { Debug.Log("NoAudioSourceFound"); StoryEventManager.OnAudioFinished(); return; } GameManager.PlayAudio(_audioToPlay); }
public StoryEventManager() { _config = (EditorConfig)Resources.Load("EditorConfig"); instance = this; }