An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
843 B

using UnityEngine;
using System.Collections;
using Fungus;
// The parallax effect is achieved by attaching a Parallax script to each sprite that requires a
// parallax offset. The offset is then applied automatically whenever the camera moves around the active Room.
// There is a handy parallax sprite prefab in Fungus/Prefabs/ParallaxSprite.prefab
public class ParallaxRoom : Room
{
public View viewA;
public View viewB;
public Button menuButton;
public Room menuRoom;
void OnEnter()
{
SetView(viewA);
Say("Let's zoom in!");
PanToView(viewB, 2);
Say("Oooh! Nice parallax!");
PanToView(viewA, 2);
Say("Now you have a go!");
Say("Swipe the screen to pan around.");
ShowButton(menuButton, OnHomeButtonClicked);
StartManualPan(viewA, viewB, 0f);
}
void OnHomeButtonClicked()
{
MoveToRoom(menuRoom);
}
}