Browse Source

Fixed recip[e

master
MB 5 years ago
parent
commit
12fe09e1c9
2 changed files with 8 additions and 8 deletions
  1. +2
    -2
      Assets/Prefabs/RealLocalPlayer.prefab
  2. +6
    -6
      Assets/Scipts/Recipe.cs

+ 2
- 2
Assets/Prefabs/RealLocalPlayer.prefab View File

@ -1028,7 +1028,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1327932106731578} m_GameObject: {fileID: 1327932106731578}
m_LocalRotation: {x: 0.38268343, y: -0, z: -0, w: 0.92387956} 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_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 4713031430525266} m_Father: {fileID: 4713031430525266}
@ -1222,7 +1222,7 @@ MonoBehaviour:
playerModel: {fileID: 1706194438886280} playerModel: {fileID: 1706194438886280}
playerAnim: {fileID: 95357577853386682} playerAnim: {fileID: 95357577853386682}
dummieAnims: [] dummieAnims: []
scale: 0.1
scale: 1
charControl: {fileID: 143426586791887808} charControl: {fileID: 143426586791887808}
Animator: {fileID: 95357577853386682} Animator: {fileID: 95357577853386682}
Speed: 5 Speed: 5

+ 6
- 6
Assets/Scipts/Recipe.cs View File

@ -22,7 +22,12 @@ public class Recipe : MonoBehaviour {
// Use this for initialization // Use this for initialization
void Start () { void Start () {
for (int i = 0; i < PlayerCount; i++)
localPlayer = PlayersManager.Instance.LocalPlayer.GetComponent<Player>();
PlayerCount = PlayersManager.Instance.RemotePlayers.Count + 1;
localPlayer.GetComponent<LocalPlayer>().recipe = this;
for (int i = 0; i < PlayerCount; i++)
{ {
int rand = UnityEngine.Random.Range(0, Qtys.Length - 1); int rand = UnityEngine.Random.Range(0, Qtys.Length - 1);
Qtys[rand] += 1; Qtys[rand] += 1;
@ -32,11 +37,6 @@ public class Recipe : MonoBehaviour {
Frames[i].VegetableSpot.sprite = Veggies[i].Image; Frames[i].VegetableSpot.sprite = Veggies[i].Image;
Frames[i].Qty.text = Qtys[i] + ""; Frames[i].Qty.text = Qtys[i] + "";
} }
localPlayer = PlayersManager.Instance.LocalPlayer.GetComponent<Player>();
PlayerCount = PlayersManager.Instance.RemotePlayers.Count + 1;
localPlayer.GetComponent<LocalPlayer>().recipe = this;
} }
private void OnEnable() private void OnEnable()

Loading…
Cancel
Save