mirror of
https://github.com/ConjureETS/DeathBook.git
synced 2026-03-23 20:10:58 +00:00
Implemented shout bubbles
Signed-off-by: RosimInc <rosim_inc@hotmail.com>
This commit is contained in:
parent
6a8f4124df
commit
d798ff166c
@ -17,6 +17,23 @@ GameObject:
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &138142
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 495284}
|
||||
- 33: {fileID: 3383236}
|
||||
- 23: {fileID: 2397622}
|
||||
m_Layer: 0
|
||||
m_Name: BloodSplatter
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!1 &147480
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -28,7 +45,7 @@ GameObject:
|
||||
- 33: {fileID: 3395424}
|
||||
- 23: {fileID: 2372840}
|
||||
m_Layer: 0
|
||||
m_Name: BloodSplatter
|
||||
m_Name: ShoutBubble
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@ -98,9 +115,10 @@ Transform:
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 193868}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -.133731544, y: -.756275117, z: 0}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 495284}
|
||||
- {fileID: 424146}
|
||||
- {fileID: 496448}
|
||||
m_Father: {fileID: 0}
|
||||
@ -112,11 +130,11 @@ Transform:
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 147480}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -.0109999999}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_LocalPosition: {x: .800000012, y: .75, z: -.0500000007}
|
||||
m_LocalScale: {x: .75, y: .75, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 410576}
|
||||
m_RootOrder: 0
|
||||
m_RootOrder: 1
|
||||
--- !u!4 &476902
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
@ -129,6 +147,18 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 496448}
|
||||
m_RootOrder: 0
|
||||
--- !u!4 &495284
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 138142}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -.0109999999}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 410576}
|
||||
m_RootOrder: 0
|
||||
--- !u!4 &496448
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
@ -142,7 +172,7 @@ Transform:
|
||||
- {fileID: 476902}
|
||||
- {fileID: 498100}
|
||||
m_Father: {fileID: 410576}
|
||||
m_RootOrder: 1
|
||||
m_RootOrder: 2
|
||||
--- !u!4 &498100
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
@ -261,6 +291,30 @@ MeshRenderer:
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 1
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 3480ff1ba6e1dea4da6b793db1251755, type: 2}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 1
|
||||
m_ImportantGI: 0
|
||||
m_AutoUVMaxDistance: .5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!23 &2397622
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 138142}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 1
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 8c192887af84c6d489323981a0248291, type: 2}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
@ -296,6 +350,13 @@ MeshFilter:
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 136744}
|
||||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!33 &3383236
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 138142}
|
||||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!33 &3387390
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 1
|
||||
@ -368,7 +429,8 @@ MonoBehaviour:
|
||||
KillHoldDuration: 2
|
||||
xMarkLeft: {fileID: 11439868}
|
||||
xMarkRight: {fileID: 11422410}
|
||||
bloodSplatter: {fileID: 2372840}
|
||||
bloodSplatter: {fileID: 2397622}
|
||||
shoutBubble: {fileID: 2372840}
|
||||
--- !u!114 &11422410
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
|
||||
165
Assets/Resources/Materials/ShoutBubble.mat
Normal file
165
Assets/Resources/Materials/ShoutBubble.mat
Normal file
@ -0,0 +1,165 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: ShoutBubble
|
||||
m_Shader: {fileID: 32, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 5
|
||||
m_CustomRenderQueue: -1
|
||||
m_SavedProperties:
|
||||
serializedVersion: 2
|
||||
m_TexEnvs:
|
||||
data:
|
||||
first:
|
||||
name: _MainTex
|
||||
second:
|
||||
m_Texture: {fileID: 2800000, guid: 856ca562f724d934e89bca0999754c23, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _BumpMap
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _DetailNormalMap
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _ParallaxMap
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _OcclusionMap
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _EmissionMap
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _DetailMask
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _DetailAlbedoMap
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _MetallicGlossMap
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
data:
|
||||
first:
|
||||
name: _Cutoff
|
||||
second: .5
|
||||
data:
|
||||
first:
|
||||
name: _Shininess
|
||||
second: .257999986
|
||||
data:
|
||||
first:
|
||||
name: _SrcBlend
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _DstBlend
|
||||
second: 0
|
||||
data:
|
||||
first:
|
||||
name: _Parallax
|
||||
second: .0199999996
|
||||
data:
|
||||
first:
|
||||
name: _ZWrite
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _Glossiness
|
||||
second: .5
|
||||
data:
|
||||
first:
|
||||
name: _BumpScale
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _OcclusionStrength
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _DetailNormalMapScale
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _UVSec
|
||||
second: 0
|
||||
data:
|
||||
first:
|
||||
name: _EmissionScaleUI
|
||||
second: 0
|
||||
data:
|
||||
first:
|
||||
name: _Mode
|
||||
second: 0
|
||||
data:
|
||||
first:
|
||||
name: _Metallic
|
||||
second: 0
|
||||
data:
|
||||
first:
|
||||
name: _Ratio
|
||||
second: 0
|
||||
m_Colors:
|
||||
data:
|
||||
first:
|
||||
name: _EmissionColor
|
||||
second: {r: 0, g: 0, b: 0, a: 0}
|
||||
data:
|
||||
first:
|
||||
name: _Color
|
||||
second: {r: 1, g: 1, b: 1, a: 1}
|
||||
data:
|
||||
first:
|
||||
name: _SpecColor
|
||||
second: {r: .5, g: .5, b: .5, a: 0}
|
||||
data:
|
||||
first:
|
||||
name: _EmissionColorUI
|
||||
second: {r: 1, g: 1, b: 1, a: 1}
|
||||
data:
|
||||
first:
|
||||
name: _CompletedColor
|
||||
second: {r: 0, g: 0, b: 0, a: 0}
|
||||
data:
|
||||
first:
|
||||
name: _RemainingColor
|
||||
second: {r: 1, g: 1, b: 1, a: 1}
|
||||
8
Assets/Resources/Materials/ShoutBubble.mat.meta
Normal file
8
Assets/Resources/Materials/ShoutBubble.mat.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3480ff1ba6e1dea4da6b793db1251755
|
||||
timeCreated: 1439775713
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -43,7 +43,6 @@ namespace DeathBook.Model
|
||||
|
||||
link.Awareness += Self.Strategy.GetDeathNoticing(1f /*Friend.Popularity*/, Link.Importance, Self.FriendCount, Self.AwarenessLevel);
|
||||
|
||||
link.Awareness = Mathf.Min(link.Awareness + deltaTime * 0.1f, 1f);
|
||||
if (link.Awareness >= 1f)
|
||||
{
|
||||
self.NoticeDeath(this);
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using DeathBook.Util;
|
||||
|
||||
namespace DeathBook.Model
|
||||
@ -43,6 +42,18 @@ namespace DeathBook.Model
|
||||
float change = value - awarenessLevel;
|
||||
awarenessLevel = value;
|
||||
LevelManager.Instance.GameLevel.AddAwareness(change);
|
||||
NotifyObservers();
|
||||
}
|
||||
}
|
||||
|
||||
private static Level level;
|
||||
private static Level GameLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
if (level == null)
|
||||
level = LevelManager.Instance.GameLevel;
|
||||
return level;
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,8 +69,15 @@ namespace DeathBook.Model
|
||||
private Sprite picture;
|
||||
public Sprite Picture { get { return picture; } }
|
||||
|
||||
private Action onSelected;
|
||||
public Action OnSelected {get {return onSelected;} set { onSelected = value; } }
|
||||
private System.Action onSelected;
|
||||
public System.Action OnSelected {get {return onSelected;} set { onSelected = value; } }
|
||||
|
||||
private Status status = null;
|
||||
public Status CurrentStatus
|
||||
{
|
||||
get { return status; }
|
||||
set { status = value; NotifyObservers(); }
|
||||
}
|
||||
|
||||
private GameStrategy strategy;
|
||||
public GameStrategy Strategy
|
||||
@ -110,30 +128,32 @@ namespace DeathBook.Model
|
||||
//Debug.Log("Person " + id + " died!");
|
||||
alive = false;
|
||||
|
||||
if (LevelManager.Instance.GameLevel.tutorialInt == 4)
|
||||
LevelManager.Instance.GameLevel.allowNext = true;
|
||||
if (GameLevel.tutorialInt == 4)
|
||||
GameLevel.allowNext = true;
|
||||
|
||||
foreach (Friendship f in friendsList)
|
||||
f.Other.NotifyFriendWasKilled();
|
||||
NotifyObservers();
|
||||
|
||||
LevelManager.Instance.GameLevel.RegisterKill(this);
|
||||
GameLevel.RegisterKill(this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void NoticeDeath(Friendship f)
|
||||
{
|
||||
int deathTime = LevelManager.Instance.GameLevel.GameTime;
|
||||
int deathTime = GameLevel.GameTime;
|
||||
int sinceLastDeath = numDeadFriends == 0 ? int.MaxValue/2 : deathTime - lastFriendDeath;
|
||||
|
||||
float strategyOutput = Strategy.GetAwarenessChange(numDeadFriends, numAliveFriends, sinceLastDeath);
|
||||
|
||||
AwarenessLevel = Mathf.Min(AwarenessLevel + strategyOutput, 1f);
|
||||
|
||||
NotifyObservers();
|
||||
if (Random.value < 0.3f)
|
||||
{
|
||||
CurrentStatus = new Status(GameLevel.GameTime, f);
|
||||
}
|
||||
|
||||
|
||||
//Debug.Log("I am " + id + " and I know my friend " + f.Friend.Id + " was killed.. " + strategyOutput);
|
||||
}
|
||||
|
||||
@ -145,8 +165,35 @@ namespace DeathBook.Model
|
||||
return !(time < ConnectionTime && time > DisconnectionTime);
|
||||
}
|
||||
|
||||
private void ShareStatus()
|
||||
{
|
||||
if (Random.value < 0.3f)
|
||||
{
|
||||
foreach (Friendship f in friendsList)
|
||||
f.Friend.ReceiveStatus(CurrentStatus);
|
||||
}
|
||||
}
|
||||
|
||||
public void ReceiveStatus(Status newStatus)
|
||||
{
|
||||
Debug.Log("Oh noes, " + newStatus.Friends.Friend + " died...");
|
||||
/*foreach (Friendship f in friendsList)
|
||||
{
|
||||
if (f.Friend == newStatus.Friends) ;
|
||||
}*/
|
||||
}
|
||||
|
||||
public void Update(float deltaTime)
|
||||
{
|
||||
if (CurrentStatus != null)
|
||||
{
|
||||
if (CurrentStatus.EndTime < GameLevel.GameTime)
|
||||
{
|
||||
ShareStatus();
|
||||
CurrentStatus = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Alive)
|
||||
return;
|
||||
|
||||
|
||||
@ -2,8 +2,20 @@
|
||||
|
||||
namespace DeathBook.Model
|
||||
{
|
||||
public class Status : Post
|
||||
public class Status
|
||||
{
|
||||
//TODO
|
||||
/*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; } }
|
||||
|
||||
public Status(int startTime, Friendship friendship)
|
||||
{
|
||||
/*this.startTime = startTime;*/
|
||||
this.endTime = startTime = (int) Utils.GetRandomValue(60*1.5f, 35, 3);
|
||||
friends = friendship;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -23,7 +23,8 @@ public class PersonNode : MonoBehaviour, IObserver
|
||||
public float KillHoldDuration = 2f;
|
||||
public RatioProgression xMarkLeft;
|
||||
public RatioProgression xMarkRight;
|
||||
public Renderer bloodSplatter;
|
||||
public Renderer bloodSplatter;
|
||||
public Renderer shoutBubble;
|
||||
|
||||
private List<Link> _links;
|
||||
private bool _highlighted = false;
|
||||
@ -157,6 +158,8 @@ public class PersonNode : MonoBehaviour, IObserver
|
||||
//If dead -> set offline until all friends are aware, then add a big red X to profile pic
|
||||
if (_model.Alive)
|
||||
{
|
||||
shoutBubble.gameObject.SetActive(_model.CurrentStatus != null);
|
||||
|
||||
SetColors();
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user