Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnicool committed Apr 19, 2018
2 parents 8fde988 + 733a081 commit bcc373c
Show file tree
Hide file tree
Showing 15 changed files with 534 additions and 43 deletions.
6 changes: 5 additions & 1 deletion Assets/Data/Goal/LocationGoalPlayer.asset
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c6630866c4a843946a789218cf72f679, type: 3}
m_Name: LocationGoalPlayer
m_EditorClassIdentifier:
TargetGridPosition: []
TargetGridPosition:
- PlayerNumber: 0
Location: {x: 2, y: 4}
- PlayerNumber: 1
Location: {x: 2, y: 2}
12 changes: 6 additions & 6 deletions Assets/Data/Grids/Grid_demo1.asset
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ MonoBehaviour:
- ChannelMaterials:
- {fileID: 2100000, guid: 59f62f02069d6df47b65c65bf835b176, type: 2}
- {fileID: 2100000, guid: 172a18ba7d76ad146a2081ffd5161c5b, type: 2}
DecorationData: {fileID: 11400000, guid: 9a8327d31861d6748b2ea5935d05d848,
DecorationData: {fileID: 11400000, guid: 99126c26551877946babed7444451c8e,
type: 2}
RelativePosition: {x: 0, y: 24, z: 0}
Scale: 10
RelativePosition: {x: 0, y: 32, z: 8}
Scale: 1
Rotation: 0
Orientation: 5
Type: 1
Expand Down Expand Up @@ -146,10 +146,10 @@ MonoBehaviour:
- ChannelMaterials:
- {fileID: 2100000, guid: 59f62f02069d6df47b65c65bf835b176, type: 2}
- {fileID: 2100000, guid: 172a18ba7d76ad146a2081ffd5161c5b, type: 2}
DecorationData: {fileID: 11400000, guid: 9a8327d31861d6748b2ea5935d05d848,
DecorationData: {fileID: 11400000, guid: 99126c26551877946babed7444451c8e,
type: 2}
RelativePosition: {x: 0, y: 24, z: 0}
Scale: 10
RelativePosition: {x: 0, y: 32, z: -8}
Scale: 1
Rotation: 0
Orientation: 1
Type: 1
Expand Down
12 changes: 8 additions & 4 deletions Assets/Data/Tiles/Decorations/Lever.asset
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3afcb17830163fc45884b3f3ded6154b, type: 3}
m_Name: Lever
m_EditorClassIdentifier:
Mesh: {fileID: 0}
Material: {fileID: 0}
MeshToAnimate: {fileID: 0}
MaterialOfMeshToAnimate: {fileID: 0}
Mesh: {fileID: 4300000, guid: e473f35f8f5c669469885fee4e242487, type: 3}
Material: {fileID: 2100000, guid: 2a9da3a078bb5b849a7aa78117841feb, type: 2}
MeshToAnimate: {fileID: 4300000, guid: 1a70ad61a87e5a340b53dbb6bc38a2b1, type: 3}
MaterialOfMeshToAnimate: {fileID: 2100000, guid: 2a9da3a078bb5b849a7aa78117841feb,
type: 2}
AnimatePosition: {x: 0, y: 0, z: 0}
StartRotation: {x: -45, y: 0, z: 0}
EndRotation: {x: 45, y: 0, z: 0}
Walkable: 1
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ Material:
- _ZWrite: 1
- _node_1169: 2
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 0}
- _Color: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 0}
4 changes: 2 additions & 2 deletions Assets/Prefabs/CameraContainer.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1047995824625588}
m_LocalRotation: {x: 0.23911765, y: 0.3696438, z: -0.09904577, w: 0.89239913}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4096140716981568}
Expand Down Expand Up @@ -185,7 +185,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.6691177, g: 0.6691177, b: 0.6691177, a: 0}
m_Color: {r: 0, g: 0.5034485, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
Expand Down
4 changes: 2 additions & 2 deletions Assets/Prefabs/PhotonManager.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ MonoBehaviour:
ObservedComponents:
- {fileID: 0}
ObservedComponentsFoldoutOpen: 1
viewIdField: 1
instantiationId: 1
viewIdField: 0
instantiationId: -1
currentMasterID: -1
isRuntimeInstantiated: 0
--- !u!114 &114512755704445868
Expand Down
21 changes: 14 additions & 7 deletions Assets/Prefabs/UI/CommandController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Assets.Data.Command;
using System.Linq;
using Assets.Data.Command;
using Assets.Data.Levels;
using Assets.Scripts;
using UnityEngine.Assertions;
using Assets.Scripts.Lib.Helpers;
Expand Down Expand Up @@ -30,13 +32,10 @@ public enum ReadyButtonState

public override void Awake() {
EventManager.InitializeUi += Initialize;
_gameManager = GameManager.GetInstance();
_commandLibrary = _gameManager.CommandLibrary;

Assert.IsNotNull(_commandLibrary);
_gameManager.PlayersInitialized += /*(_player _playerInitialized)*/ () =>

EventManager.PlayersInitialized += /*(_player _playerInitialized)*/ () =>
{
this._player = _gameManager.Players.GetLocalPlayer().Player;
this._player = GameManager.GetInstance().Players.GetLocalPlayer().Player;
print("_player shoudl be filled");
Assert.IsNotNull(_player);

Expand All @@ -46,12 +45,20 @@ public override void Awake() {
{
SetReadyButtonState(ReadyButtonState.StopButton);
};

EventManager.LevelReset += (levelData, players) =>
{
SetReadyButtonState(ReadyButtonState.ReadyButton);
};
}



public void Initialize()
{
_gameManager = GameManager.GetInstance();
_commandLibrary = _gameManager.CommandLibrary;

//Initialize the ready button and add listener
ReadyButton.GetComponent<Button>().onClick.AddListener(OnReadyButtonClicked);
ReadyButton.GetComponent<Image>().sprite = _gameManager.PrefabContainer.PlayButton;
Expand Down
13 changes: 12 additions & 1 deletion Assets/Prefabs/UI/LevelUI.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -3816,7 +3816,18 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 114502085048644212}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 114752909775571130}
m_MethodName: OnClickContinue
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &114812676876597114
Expand Down
11 changes: 5 additions & 6 deletions Assets/Prefabs/UI/SequenceBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public class SequenceBar : MonoBehaviour
private void Awake()
{
EventManager.InitializeUi += Initialize;
EventManager.PlayersInitialized += () => {
Player = GameManager.GetInstance().Players.GetLocalPlayer().Player;
};
}

private void Initialize()
Expand Down Expand Up @@ -57,11 +60,6 @@ private void Initialize()

slot.transform.SetParent(gameObject.transform, false);
}

var manager = GameManager.GetInstance();
manager.PlayersInitialized += () => {
Player = manager.Players.GetLocalPlayer().Player;
};
}

public void UnShowDropInPoint(int slotIndex)
Expand Down Expand Up @@ -128,7 +126,7 @@ public void GetCount()

public void HasChanged(int commandSlotIndex, bool destroy)
{
if (destroy)
if (destroy && CommandSlots[commandSlotIndex].transform.childCount > 0)
{
//Destroy the child of the slot
var command = CommandSlots[commandSlotIndex].transform.GetChild(0).gameObject;
Expand All @@ -137,6 +135,7 @@ public void HasChanged(int commandSlotIndex, bool destroy)

//Remove the command at that index from the player
Player.RemoveCommand(commandSlotIndex);

}
}

Expand Down
Loading

0 comments on commit bcc373c

Please sign in to comment.