From 12fe09e1c97b9f8ab7a95e9dcba0250782189a43 Mon Sep 17 00:00:00 2001 From: MB Date: Sun, 27 Jan 2019 13:45:01 +1100 Subject: [PATCH] Fixed recip[e --- Assets/Prefabs/RealLocalPlayer.prefab | 4 ++-- Assets/Scipts/Recipe.cs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Assets/Prefabs/RealLocalPlayer.prefab b/Assets/Prefabs/RealLocalPlayer.prefab index b933901..6018e1e 100644 --- a/Assets/Prefabs/RealLocalPlayer.prefab +++ b/Assets/Prefabs/RealLocalPlayer.prefab @@ -1028,7 +1028,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1327932106731578} m_LocalRotation: {x: 0.38268343, y: -0, z: -0, w: 0.92387956} - m_LocalPosition: {x: 0, y: 13.1, z: -13.08} + m_LocalPosition: {x: 0, y: 30, z: -30} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 4713031430525266} @@ -1222,7 +1222,7 @@ MonoBehaviour: playerModel: {fileID: 1706194438886280} playerAnim: {fileID: 95357577853386682} dummieAnims: [] - scale: 0.1 + scale: 1 charControl: {fileID: 143426586791887808} Animator: {fileID: 95357577853386682} Speed: 5 diff --git a/Assets/Scipts/Recipe.cs b/Assets/Scipts/Recipe.cs index 027c348..90d6301 100644 --- a/Assets/Scipts/Recipe.cs +++ b/Assets/Scipts/Recipe.cs @@ -22,7 +22,12 @@ public class Recipe : MonoBehaviour { // Use this for initialization void Start () { - for (int i = 0; i < PlayerCount; i++) + + localPlayer = PlayersManager.Instance.LocalPlayer.GetComponent(); + PlayerCount = PlayersManager.Instance.RemotePlayers.Count + 1; + + localPlayer.GetComponent().recipe = this; + for (int i = 0; i < PlayerCount; i++) { int rand = UnityEngine.Random.Range(0, Qtys.Length - 1); Qtys[rand] += 1; @@ -32,11 +37,6 @@ public class Recipe : MonoBehaviour { Frames[i].VegetableSpot.sprite = Veggies[i].Image; Frames[i].Qty.text = Qtys[i] + ""; } - localPlayer = PlayersManager.Instance.LocalPlayer.GetComponent(); - PlayerCount = PlayersManager.Instance.RemotePlayers.Count + 1; - - localPlayer.GetComponent().recipe = this; - } private void OnEnable()