Exemple #1
0
    protected void PerformAction(IAvatar avatar)
    {
        DebugUtilities.Assert(actorScenePrefab != null, "You must have a valid actorScene for the action");
        var instantiatedScene = ActorSceneUtility.CreateSceneWithAvatarAndInteractable(actorScenePrefab.gameObject, avatar, gameObject);

        instantiatedScene.PlayScene(avatar.playerNotifications);
    }
Exemple #2
0
    void Initiate()
    {
        var mainActorObject = GameObject.FindGameObjectWithTag("Player");

        DebugUtilities.Assert(mainActorObject != null, "Couldn't fint IAvatar from tag Player");
        var avatar = mainActorObject.GetComponentInChildren <IAvatar>();

        DebugUtilities.Assert(avatar != null, "Found an object with tag Player but didn't have an actor.");
        var actorScene = ActorSceneUtility.CreateSceneWithAvatar(actorScenePrefab, avatar);

        actorScene.PlayScene(avatar.playerNotifications);
    }
    void SwordDone()
    {
        Debug.Log("Sword reported as done");
        var scene = ActorSceneUtility.CreateSceneWithAvatarAndInteractable(swordDoneScenes[finishedSwordCount].gameObject, characterAvatar, sword.gameObject);

        scene.endOfSceneNotification += OnSwordDoneSceneEnded;
//		swordNotifications.PauseTimer();
        if (sword != null)
        {
            sword.IsPaused(true);
        }
        scene.PlayScene(characterAvatar.playerNotifications);
    }
    void PickupSword()
    {
        Debug.Log("Picking up a new sword");
        var scene = ActorSceneUtility.CreateSceneWithAvatar(pickupSwordScene.gameObject, characterAvatar);

        scene.endOfSceneNotification += OnPickupSwordSceneEnded;
//		swordNotifications.PauseTimer();
        if (sword != null)
        {
            sword.IsPaused(true);
        }
        scene.PlayScene(characterAvatar.playerNotifications);
    }
Exemple #5
0
    public ActorScene CreateQuest(ActorScene scene)
    {
        var instantiatedCutscene = ActorSceneUtility.CreateSceneWithAvatar(scene.gameObject, GetComponent <IAvatar>());

        var instantiatedQuestObject = instantiatedCutscene as Quest;

        if (instantiatedQuestObject != null)
        {
            ReceiveQuest(instantiatedQuestObject);
        }

        return(instantiatedCutscene);
    }
Exemple #6
0
    protected override void Act()
    {
        var avatar = actingInScene.GetMainAvatar();

        if (avatar)
        {
            avatar.OnCutsceneStart();
        }

        DebugUtilities.Assert(scene != null, "Actor scene is null in start actor scene:" + name);

        instantiatedCutscene = ActorSceneUtility.CreateSceneWithAvatar(scene, avatar);
        DebugUtilities.Assert(instantiatedCutscene != null, "No valid cutscene specified:" + scene.name);
        instantiatedCutscene.endFunction = OnCutscenePlayed;
        instantiatedCutscene.PlayScene(avatar.playerNotifications);
    }
    void PlayScene(GameObject actorScenePrefab)
    {
        var scene = ActorSceneUtility.CreateSceneWithAvatar(actorScenePrefab, actingInScene.GetMainAvatar());

        scene.PlayScene(actingInScene.GetMainAvatar().playerNotifications);
    }