Beispiel #1
0
    public void OnSetupNextLine(ActorScene scene, ActorSceneComponent part)
    {
        if (part is ActorCompleteMinigame || part is ActorShowQuestParchment || part is ActorPosition)
        {
            Debug.Log("Note: We are not saving progress for type:" + part.GetType().ToString());
            return;
        }
        var questPartNotification = new QuestPartNotification(scene as Quest, part);

        SendMessage("OnStartedQuestPart", questPartNotification);
    }
    void PlayNextLine()
    {
        gotoNextLine = false;

        if (SceneIsDone())
        {
            CompletedScene();
            return;
        }

        if (activeLine != null)
        {
            activeLine.Dispose();
            activeLine = null;
        }

        Debug.Log($"play next line {lineIndex} ");
        activeLine = lines[lineIndex];
        if (activeLine)
        {
            Debug.Log("Actorscene " + name + " sets line: " + activeLine.name + " _________________________________________");
        }
        else
        {
            Debug.Log("Actorscene " + name + " has a missing line with index: " + lineIndex + " _________________________________________!!");
        }


#if UNITY_EDITOR
        debugString = name + ": " + activeLine.name;
#endif

        DebugUtilities.Assert(activeLine != null, "Active Line is null");
        lineIndex++;

        if (activeLineNotification != null)
        {
            activeLineNotification(this, activeLine);
        }

        DebugUtilities.Assert(activeLine != null, "Active Line is null before act");
        Debug.Log("ACT: scene: " + activeLine.name + " " + activeLine.GetType());

        activeLine.OnComponentDone   += OnComponentDone;
        activeLine.OnComponentFailed += OnComponentFailed;
        activeLine.OnComponentQuit   += OnComponentQuit;

        activeLine.ActInScene(this);

        SetupMoveAndInteraction();

        isResuming = false;
    }
Beispiel #3
0
    void ComponentEnded(ActorSceneComponent componentThatIsDone)
    {
        Debug.Log("STOP ACTING (splitter) " + componentThatIsDone.name);
        componentThatIsDone.Dispose();
        foreach (var component in components)
        {
            if (component.ShouldUpdate)
            {
                return;
            }
        }

        ComponentDone();
    }
    void CloseScene()
    {
        if (activeLine != null)
        {
            activeLine.Dispose();
            activeLine.RemoveFromScene();
            activeLine = null;
        }

        Debug.Log("### CLOSING SCENE:" + name);

        isActingScene = false;
        PlaceActorsAfterScene();
        NotifyActorsThatSceneIsOver();
        SetInteractionForMainCharacter(true);
        SetMovementForMainCharacter(true);
        actorsInScene.Clear();
        Destroy(transform.root.gameObject);
    }
Beispiel #5
0
 void OnSubComponentQuit(ActorSceneComponent component)
 {
     Debug.Log("ActorCompleteComponents: " + component.name + " QUIT!");
     ComponentEnded(component);
 }
Beispiel #6
0
 void OnSubComponentFailed(ActorSceneComponent component)
 {
     Debug.Log("ActorCompleteComponents: " + component.name + " Failed!");
     ComponentEnded(component);
 }
Beispiel #7
0
 void OnSubComponentDone(ActorSceneComponent component)
 {
     Debug.Log("ActorCompleteComponents: " + component.name + " is done.");
     ComponentEnded(component);
 }
 public void OnStartedQuestPart(Quest quest, ActorSceneComponent component)
 {
     player.playerStorage.SetStartedQuestPart(quest.questName, component.name);
 }
 public QuestPartNotification(Quest _quest, ActorSceneComponent _part)
 {
     quest = _quest;
     part  = _part;
 }
 void OnComponentQuit(ActorSceneComponent component)
 {
     QuitScene();
 }
 void OnComponentFailed(ActorSceneComponent component)
 {
     QuitScene();
 }
 void OnComponentDone(ActorSceneComponent component)
 {
     Debug.Log("Component reported done:" + component.name);
     DebugUtilities.Assert(component == activeLine, "Got Component Done from a component that is not acting. Got:" + component.name + " expecting:" + activeLine.name);
     gotoNextLine = true;
 }
 public QuestProgress(Quest _quest, ActorSceneComponent component)
 {
     quest     = _quest;
     questPart = component;
 }