public void UnloadCanon() { canonCapsule.GetComponent <SoupData>().theSoup = null; isLoaded = false; Debug.Log("Canon unloaded and removed soup data."); currentSoup = null; }
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------- // // ------------------------- After we "CookSoup()", we use the returned soup and create a Soup object and attach the appropriate Soup stats to the SoupData script. ------------------------- // public void MakeSoup() { Soup newSoup = CookSoup(); Transform newSoupOrb = GameObject.Instantiate(soupOrb, soupOrb.position, soupOrb.rotation); // The setting active is moved to the State Machine because of the added cooking timer mechanic. // //newSoupOrb.gameObject.SetActive(true); SoupData newSoupsData = newSoupOrb.GetComponent <SoupData>(); newSoupsData.theSoup = newSoup; // Setting max amount of "portions" of soup. The player can keep grabbing soup until they've depleted all the portions. // // Hey get out of here! If you want to set the portion sizes do it through the inspector ! // //newSoupsData.currentPortions = 5; //newSoupsData.maxPortions = 5; occupyingSoup = newSoupOrb; // Setting the colour of the occupying soup. // Material newMaterial = new Material(waterShader); newMaterial.SetColor("Color_6EDA1D08", gameManager.colourManager.ConvertColour(newSoup.colour)); occupyingSoup.GetComponent <Renderer>().material = newMaterial; // Removing and resetting stuff to do with the water display. // RemoveWater(); }
public void LoadCanon(Soup theDataToLoad) { isLoaded = true; // Actual loading of soup data. // canonCapsule.GetComponent <SoupData>().theSoup = theDataToLoad; Debug.Log("Canon loaded and received data successfully."); currentSoup = canonCapsule.GetComponent <SoupData>(); }