This commit is contained in:
RosimInc 2015-08-16 23:43:30 -04:00
commit 70a3593bca
11 changed files with 2503 additions and 1349 deletions

2299
Assets/Prefabs/Canvas.prefab Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5c94559626c169f47a446ce0517b8aec
timeCreated: 1439782683
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using System.Collections.Generic;
using DeathBook.Util;
@ -77,4 +77,4 @@ namespace DeathBook.Model
}
}
}
}
}

View File

@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using System.Collections.Generic;
namespace DeathBook.Model
@ -20,4 +20,4 @@ namespace DeathBook.Model
return level = gen.GenerateLevel(numPeople, avgFriends, probability, radius, strategy);
}
}
}
}

View File

@ -1,13 +1,41 @@
using System.Collections.Generic;
using DeathBook.Util;
using System.Collections.Generic;
using UnityEngine;
namespace DeathBook.Model
{
public class PostGenerator
{
private string[] _posts;
public PostGenerator()
{
TextAsset postsFile = Resources.Load("TextFiles/FacebookPosts") as TextAsset;
_posts = postsFile.text.Split('\n');
}
public Status generateStatus(/*put stuff here*/)
{
//and here...
return null;
if (LevelManager.Instance.GameLevel.NumDead == LevelManager.Instance.GameLevel.People.Count)
{
return new Status() { Text = "" };
}
Person person = null;
// May be a bottleneck if unlucky, needs to be tested
do
{
person = LevelManager.Instance.GameLevel.People[UnityEngine.Random.Range(0, LevelManager.Instance.GameLevel.People.Count)];
} while (!person.Alive);
Status status = new Status()
{
Text = "<b>" + person.Name + "</b>" + ": " + _posts[UnityEngine.Random.Range(0, _posts.Length)]
};
return status;
}
public Headline generateHeadline(/*put stuff here*/)

View File

@ -2,20 +2,14 @@
namespace DeathBook.Model
{
public class Status
public class Status : Post
{
private int startTime;
public int StartTime { get { return startTime; } }
private int endTime;
public int EndTime { get { return endTime; } }
private Friendship friends;
public Friendship Friends { get { return friends; } }
private string _text;
public Status(int startTime, Friendship friendship)
{
this.startTime = startTime;
this.endTime = startTime + (int) Utils.GetRandomValue(700, 250, 3);
friends = friendship;
}
public string Text
{
get { return _text; }
set { _text = value; }
}
}
}

View File

@ -0,0 +1,32 @@
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using DeathBook.Model;
public class RecentPostsPanel : MonoBehaviour
{
public Text Content;
PostGenerator _postGenerator;
private float _elapsedTime = 0f;
void Start()
{
_postGenerator = new PostGenerator();
}
void Update ()
{
_elapsedTime += Time.deltaTime;
if (_elapsedTime >= 15f)
{
Status status = _postGenerator.generateStatus();
Content.text = status.Text;
_elapsedTime = 0f;
}
}
}

View File

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

View File

@ -1,21 +1,21 @@
using UnityEngine;
using System.Collections;
using DeathBook.Util;
using DeathBook.Model;
using UnityEngine.UI;
public class Timer : MonoBehaviour
{
using UnityEngine;
using System.Collections;
using DeathBook.Util;
using DeathBook.Model;
using UnityEngine.UI;
public class Timer : MonoBehaviour
{
public Text TimerText;
int lastTime = -1;
void Update()
int lastTime = -1;
void Update()
{
int time = LevelManager.Instance.GameLevel.DayTime / 30;
if (time != lastTime)
{
TimerText.text = Utils.GetTimeString(time * 30);
lastTime = time;
}
}
}
}
}
}

View File

@ -13,7 +13,7 @@ public class loadLevel : MonoBehaviour
void NextScene()
{
Application.LoadLevel("Gameplay");
Application.LoadLevel("Tutoriel");
}
}