This commit is contained in:
RosimInc 2015-08-16 19:35:09 -04:00
commit 40bb309d72
10 changed files with 1822 additions and 20 deletions

1673
Assets/Scenes/Tutoriel.unity Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 954690b6e2639f149bb1741d688d2815
timeCreated: 1439747828
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -195,8 +195,8 @@ Camera:
m_GameObject: {fileID: 608195445}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438}
m_ClearFlags: 2
m_BackGroundColor: {r: 0, g: 0, b: 0, a: .0196078438}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
@ -317,6 +317,7 @@ GameObject:
- 33: {fileID: 1865312315}
- 64: {fileID: 1865312314}
- 23: {fileID: 1865312313}
- 114: {fileID: 1865312317}
m_Layer: 0
m_Name: Background
m_TagString: Untagged
@ -379,3 +380,15 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
--- !u!114 &1865312317
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1865312312}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2931322f1f0c62f40b2d7a6e493934ca, type: 3}
m_Name:
m_EditorClassIdentifier:
timeToWait: 2

View File

@ -26,6 +26,8 @@ namespace DeathBook.Model
private float globalAwareness; //on a scale from 0 to 1
public float GlobalAwareness { get { return globalAwareness; } }
public int tutorialInt = 0;
public bool allowNext = true;
private GameStrategy strategy = null;
public GameStrategy Strategy { get { return strategy; } }

View File

@ -104,11 +104,15 @@ namespace DeathBook.Model
public bool Kill()
{
if (Online)
if (Online || (LevelManager.Instance.GameLevel.tutorialInt < 4))
return false;
//Debug.Log("Person " + id + " died!");
alive = false;
if (LevelManager.Instance.GameLevel.tutorialInt == 4)
LevelManager.Instance.GameLevel.allowNext = true;
foreach (Friendship f in friendsList)
f.Other.NotifyFriendWasKilled();
NotifyObservers();

View File

@ -42,14 +42,15 @@ public class NetworkingSphere : MonoBehaviour
private PersonNode _selectedNode;
private float _timeSinceLastClick;
private Level lvl;
// Used to disable the physics when the user has clicked on a node
private bool _isRotatingTowardsNode = false;
void Awake()
{
manager = LevelManager.Instance;
Level lvl = manager.NewLevel(levelOptions.NumPeople, levelOptions.AvgNumFriends, levelOptions.FriendshipLikeliness, levelOptions.SphereRadius, strategy);
lvl = manager.NewLevel(levelOptions.NumPeople, levelOptions.AvgNumFriends, levelOptions.FriendshipLikeliness, levelOptions.SphereRadius, strategy);
InstantiateNodes(lvl);
AssignLinks(lvl);
rb = GetComponent<Rigidbody>();
@ -97,8 +98,12 @@ public class NetworkingSphere : MonoBehaviour
delta = new Vector3();
}
if (dragging && !_isRotatingTowardsNode)
if ((dragging && !_isRotatingTowardsNode))
{
if (lvl.tutorialInt == 1)
{
lvl.allowNext = true;
}
MoveSphere();
}
@ -150,6 +155,9 @@ public class NetworkingSphere : MonoBehaviour
private void OnNodeClicked(PersonNode node)
{
if (lvl.tutorialInt == 2)
lvl.allowNext = true;
rb.angularVelocity = Vector3.zero;
if (_selectedNode != null)
@ -159,6 +167,7 @@ public class NetworkingSphere : MonoBehaviour
if (!_isRotatingTowardsNode || node != _selectedNode)
{
if (lvl.tutorialInt > 1)
FocusOnNode(node);
}
@ -196,6 +205,7 @@ public class NetworkingSphere : MonoBehaviour
public void FocusOnNode(PersonNode node)
{
StopCoroutine("RotateTowardsNodeCoroutine");
StartCoroutine("RotateTowardsNodeCoroutine", node);

View File

@ -0,0 +1,74 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using DeathBook.Model;
public class TutorialScript : MonoBehaviour {
public GameObject panel;
public Text tutorialText;
public Button btnNext;
private Level lvl;
void Start()
{
lvl = LevelManager.Instance.GameLevel;
}
void Update() {
btnNext.enabled = lvl.allowNext;
if (lvl.tutorialInt == 0)
{
Time.timeScale = 0;
lvl.allowNext = true;
tutorialText.text = "The facebook servers are full!\nMark Zuckerberg hired you, Death, to kill off a few of his users.\n\nCareful, or you might scare them away from Mark's website...";
}
else if (lvl.tutorialInt == 1)
{
tutorialText.text = "See how navigating works by holding the right mouse button and moving the sphere.\n\nThen, hit Next!";
}
else if (lvl.tutorialInt == 2)
{
tutorialText.text = "Move around by left clicking on the users in the network!";
}
else if (lvl.tutorialInt == 3)
{
tutorialText.text = "Let's see what happens when you click on a user's friend list.";
}
else if (lvl.tutorialInt == 4)
{
tutorialText.text = "Alright, time for our first victim.\nHold the LEFT mouse button over a user until the X is complete.\nBeware! The user must be offline to be killed!";
tutorialText.text += "\n\nYou can hold the mouse button until the user goes offline.";
}
else if (lvl.tutorialInt == 5)
{
tutorialText.text = "Kill many users to see how the color changes\n\nRemember, as users realize something is wrong with facebook,\nthe entire network will turn red!\n\nHaveFun!";
lvl.allowNext = true;
}
else
{
panel.SetActive(false);
}
}
public void btnClick()
{
lvl.tutorialInt++;
//Debug.Log(lvl.tutorialInt + ", aasfasf");
Time.timeScale = 1;
tutorialText.text = "eee";
lvl.allowNext = false;
//panel.transform.Translate(Vector3.right * 100);
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c42f0ece4454ca044b3152cc78312428
timeCreated: 1439753311
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -7,6 +7,7 @@ using UnityEngine.UI;
public class UIFriendPicture : MonoBehaviour
{
private Person _model;
private Level lvl;
public Person Model
{
@ -23,11 +24,14 @@ public class UIFriendPicture : MonoBehaviour
void Awake()
{
lvl = LevelManager.Instance.GameLevel;
_picture = GetComponent<Image>();
}
public void OnClick()
{
if (lvl.tutorialInt == 3)
lvl.allowNext = true;
_model.SelectNode();
_model.SelectNode();
}

View File

@ -7,3 +7,5 @@ EditorBuildSettings:
m_Scenes:
- enabled: 1
path: Assets/Scenes/Gameplay.unity
- enabled: 1
path: Assets/Scenes/splash.unity