// Use this for initialization void Start() { scoreboard = FindObjectOfType <Scoreboard>().GetComponent <Scoreboard>(); fridge = FindObjectOfType <FridgeNew>().GetComponent <FridgeNew>(); ScriptInitialization(); contentDisplay = GetComponent <DisplayPanContents>(); contentDisplay.InitiliazeDisplay(playerSide); layerFood = LayerMask.NameToLayer("Food"); if (layerFood == -1) { Debug.LogError("The Food Collision Layer does not exist!"); layerFood = LayerMask.NameToLayer("Default"); } switch (playerSide) { case CONTROLS.RIGHT: layerFoodCaught = LayerMask.NameToLayer("FoodCaughtRight"); break; case CONTROLS.LEFT: layerFoodCaught = LayerMask.NameToLayer("FoodCaughtLeft"); break; default: layerFood = LayerMask.NameToLayer("Default"); Debug.LogWarning("Could not identify playerSide! All food will be moved to Default Layer when caught."); break; } inPanPhysics = (PhysicMaterial)Resources.Load("Food Pan Physics"); outsidePanPhysics = (PhysicMaterial)Resources.Load("Food Physics"); leftOverFX = GetComponentInChildren <ParticleSystem>(); }
private void Awake() { if (instance) { Debug.LogError("Surplus Fridge!", gameObject); Destroy(gameObject); } instance = this; difficultyLevel = 0; }