fork download
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. /*Attached to prefabs in Scene*/
  6.  
  7. public class KitchenObject : MonoBehaviour
  8. {
  9. [SerializeField] private KitchenObjectSO kSO;
  10.  
  11. //private IKitchenObjectParent kitchenObjectParent;
  12.  
  13. private ClearCounterScript clearCounter;
  14.  
  15. public KitchenObjectSO GetKitchenObjectSO()
  16. {
  17. return kSO;
  18. }
  19.  
  20. public void SetClearCounter(ClearCounterScript clearCounter)
  21. {
  22. /*
  23.   * Clear the previous selected counter of its kitchen object
  24.   */
  25. if(this.clearCounter != null)
  26. {
  27. this.clearCounter.ClearKitchenObject();
  28. }
  29.  
  30. /*
  31.   * The 'designatedCounter' is the sent argument representing
  32.   * selected counter in Scene
  33.   *
  34.   * Set to the 'counter' property
  35.   */
  36. this.clearCounter = clearCounter;
  37.  
  38. if(clearCounter.HasKitchenObject())
  39. {
  40. Debug.LogError("Counter already has a Kitchen Object!");
  41. }
  42.  
  43. /*
  44.   * Inform Kitchen Object which counter it's on
  45.   */
  46. clearCounter.SetKitchenObject(this);
  47.  
  48. /*
  49.   * Move th Kitchen Object to the new counter
  50.   */
  51.  
  52. transform.parent = clearCounter.GetKitchenObjectFollowTransform();
  53. transform.localPosition = Vector3.zero;
  54. }
  55.  
  56. public ClearCounterScript GetClearCounter()
  57. {
  58. return clearCounter;
  59. }
  60.  
  61. /*public IKitchenObjectParent GetKitchenObjectParent()
  62.   {
  63.   return kitchenObjectParent;
  64.   }*/
  65.  
  66. // Start is called before the first frame update
  67. void Start()
  68. {
  69.  
  70. }
  71.  
  72. // Update is called once per frame
  73. void Update()
  74. {
  75.  
  76. }
  77. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(3,7): error CS0246: The type or namespace name `UnityEngine' could not be found. Are you missing an assembly reference?
prog.cs(7,30): error CS0246: The type or namespace name `MonoBehaviour' could not be found. Are you missing an assembly reference?
prog.cs(9,30): error CS0246: The type or namespace name `KitchenObjectSO' could not be found. Are you missing an assembly reference?
prog.cs(13,13): error CS0246: The type or namespace name `ClearCounterScript' could not be found. Are you missing an assembly reference?
prog.cs(15,12): error CS0246: The type or namespace name `KitchenObjectSO' could not be found. Are you missing an assembly reference?
prog.cs(20,33): error CS0246: The type or namespace name `ClearCounterScript' could not be found. Are you missing an assembly reference?
prog.cs(56,12): error CS0246: The type or namespace name `ClearCounterScript' could not be found. Are you missing an assembly reference?
Compilation failed: 7 error(s), 0 warnings
stdout
Standard output is empty