public static string DisplayName(this DRINK_TYPE drink) { #region INIT_ALCOHOL_NAMES string[] _names = { "EMPTY", "WASTE", "BLUE", "GREEN", "YELLOW", "BEER", "VODKA", "WHISKY", "SOJU", "SAKE", "RUM", "TEQUILA", "MOSCATO", "GRAVITY", "WATER", "BUBBLE", "LIFE", "STRENGTH", "GRASS", "FIRE", "GLITTER", "GLOWING", "SQUARE", "RAINBOW", "DORINKS_MAX" }; #endregion return(_names[(int)drink]); }
public void DeselectDrink() { // Ver. If you can select one drink only. if (_src1 != DRINK_TYPE.EMPTY) { _src1 = DRINK_TYPE.EMPTY; } _alcoholContent1 = 0; // Ver. If you can select two drinks. //if (_src2 != DRINK_TYPE.EMPTY) //{ // _src2 = DRINK_TYPE.EMPTY; // _compost = DRINK_TYPE.EMPTY; //} //else if (_src1 != DRINK_TYPE.EMPTY) // _src1 = DRINK_TYPE.EMPTY; }
void Start() { #region INIT_CHART_DATA _cd.Add(new ChartData(DRINK_TYPE.BLUE, DRINK_TYPE.BEER, DRINK_TYPE.BEER)); _cd.Add(new ChartData(DRINK_TYPE.BLUE, DRINK_TYPE.BEER, DRINK_TYPE.BEER)); _cd.Add(new ChartData(DRINK_TYPE.BLUE, DRINK_TYPE.VODKA, DRINK_TYPE.GRAVITY)); _cd.Add(new ChartData(DRINK_TYPE.BLUE, DRINK_TYPE.WHISKY, DRINK_TYPE.WHISKY)); _cd.Add(new ChartData(DRINK_TYPE.BLUE, DRINK_TYPE.SOJU, DRINK_TYPE.WATER)); _cd.Add(new ChartData(DRINK_TYPE.BLUE, DRINK_TYPE.SAKE, DRINK_TYPE.BUBBLE)); _cd.Add(new ChartData(DRINK_TYPE.BLUE, DRINK_TYPE.RUM, DRINK_TYPE.RUM)); _cd.Add(new ChartData(DRINK_TYPE.BLUE, DRINK_TYPE.TEQUILA, DRINK_TYPE.TEQUILA)); _cd.Add(new ChartData(DRINK_TYPE.BLUE, DRINK_TYPE.MOSCATO, DRINK_TYPE.LIFE)); _cd.Add(new ChartData(DRINK_TYPE.GREEN, DRINK_TYPE.BEER, DRINK_TYPE.BEER)); _cd.Add(new ChartData(DRINK_TYPE.GREEN, DRINK_TYPE.VODKA, DRINK_TYPE.VODKA)); _cd.Add(new ChartData(DRINK_TYPE.GREEN, DRINK_TYPE.WHISKY, DRINK_TYPE.STRENGTH)); _cd.Add(new ChartData(DRINK_TYPE.GREEN, DRINK_TYPE.SOJU, DRINK_TYPE.GRASS)); _cd.Add(new ChartData(DRINK_TYPE.GREEN, DRINK_TYPE.SAKE, DRINK_TYPE.SAKE)); _cd.Add(new ChartData(DRINK_TYPE.GREEN, DRINK_TYPE.RUM, DRINK_TYPE.RUM)); _cd.Add(new ChartData(DRINK_TYPE.GREEN, DRINK_TYPE.TEQUILA, DRINK_TYPE.FIRE)); _cd.Add(new ChartData(DRINK_TYPE.GREEN, DRINK_TYPE.MOSCATO, DRINK_TYPE.MOSCATO)); _cd.Add(new ChartData(DRINK_TYPE.YELLOW, DRINK_TYPE.BEER, DRINK_TYPE.GLITTER)); _cd.Add(new ChartData(DRINK_TYPE.YELLOW, DRINK_TYPE.VODKA, DRINK_TYPE.VODKA)); _cd.Add(new ChartData(DRINK_TYPE.YELLOW, DRINK_TYPE.WHISKY, DRINK_TYPE.GLOWING)); _cd.Add(new ChartData(DRINK_TYPE.YELLOW, DRINK_TYPE.SOJU, DRINK_TYPE.SOJU)); _cd.Add(new ChartData(DRINK_TYPE.YELLOW, DRINK_TYPE.SAKE, DRINK_TYPE.SQUARE)); _cd.Add(new ChartData(DRINK_TYPE.YELLOW, DRINK_TYPE.RUM, DRINK_TYPE.RUM)); _cd.Add(new ChartData(DRINK_TYPE.YELLOW, DRINK_TYPE.TEQUILA, DRINK_TYPE.TEQUILA)); _cd.Add(new ChartData(DRINK_TYPE.YELLOW, DRINK_TYPE.MOSCATO, DRINK_TYPE.RAINBOW)); #endregion speed = 5.0f; _src1 = _src2 = _compost = DRINK_TYPE.EMPTY; Cursor.visible = false; Cursor.lockState = CursorLockMode.Confined; throwAngle = 90 - throwAngle; }
public void GrabObject() { // If you don't have anything if (_currentObject == null) { RaycastHit hit; Ray ray = new Ray(transform.position, transform.forward); int touchableDistance = 1000; //Assign object as current object if (Physics.Raycast(ray, out hit, touchableDistance)) { //Check if object is interactable if (hit.collider.gameObject.GetComponent <InteractableObjects>() != null && hit.collider.gameObject.tag != "Cocktail") { _currentObject = hit.collider.gameObject; _currentObject.transform.rotation = Quaternion.identity; _currentRB = _currentObject.GetComponent <Rigidbody>(); _currentRB.detectCollisions = false; _currentRB.useGravity = false; _interactableObject = _currentObject.GetComponent <InteractableObjects>(); MoveObjectTowardsPlayer(); StartCoroutine("CheckLookObject"); /////////////////////////////////////////////// if (_temp = _currentObject.GetComponent <InteractableObjects>()) { if (_src1 != DRINK_TYPE.EMPTY) { _src1 = _temp.GetDrinkType(); _alcoholContent1 = _temp.GetAlcoholContent(); } } ///////////////////////////////////////////////// } } } else { } }
public void SetDrinkType(DRINK_TYPE pouringThing) { drinkType = pouringThing; }
public void AddAlcoholContent(DRINK_TYPE drink) { currentAlcoholContent += AlcoholContent[(int)drink - 5]; }
public ChartData(DRINK_TYPE src1, DRINK_TYPE src2, DRINK_TYPE compost) { _src1 = src1; _src2 = src2; _compost = compost; }
public void PourCurrentDrink() { // Animetion rotateArmToDrink(ARM_MOTION.DRINKING, true); InteractableObjects currentObject = _currentObject.gameObject.GetComponent <InteractableObjects>(); //Only can pour drinks if (currentObject.GetObjectType() == OBJECT_TYPE.DRINKS) { // Current I have thing. DRINK_TYPE src1 = currentObject.GetDrinkType(); // Current I look thing. DRINK_TYPE src2 = _currentLookingGlassCup.GetDrinkType(); switch (_currentLookingGlassCup.GetGlassState()) { case GLASS_STATE.EMPTY: //Sound AudioSource.PlayClipAtPoint(pourSound, transform.position); // If I look cup is empty, I just pour. _currentLookingGlassCup.SetDrinkType(src1); _currentLookingGlassCup.AddAlcoholContent(src1); _currentLookingGlassCup.SetGlassState(GLASS_STATE.HALF); Debug.Log("Glass is " + currentObject.GetDrinkType()); Debug.Log("Glass is " + currentObject.GetGlassState()); Debug.Log("This AC is " + currentObject.GetAlcoholContent()); Debug.Log("POURING"); break; case GLASS_STATE.HALF: //Sound AudioSource.PlayClipAtPoint(pourSound, transform.position); // I pour the same thing if (src1 == src2) { _currentLookingGlassCup.SetDrinkType(src1); _currentLookingGlassCup.AddAlcoholContent(src1); } // I pour the waste. or I pour any thing to the waste. if (src1 == DRINK_TYPE.WASTE || src2 == DRINK_TYPE.WASTE) { _currentLookingGlassCup.SetDrinkType(DRINK_TYPE.WASTE); _currentLookingGlassCup.AddAlcoholContent(src1); } // I investigate combination when I pour any drink to other drink. foreach (ChartData data in _cd) { if (data._src1 == src1) { if (data._src2 == src2) { _currentLookingGlassCup.SetDrinkType(data._compost); _currentLookingGlassCup.AddAlcoholContent(src1); } } if (data._src1 == src2) { if (data._src2 == src1) { _currentLookingGlassCup.SetDrinkType(data._compost); _currentLookingGlassCup.AddAlcoholContent(src1); } } } _currentLookingGlassCup.SetGlassState(GLASS_STATE.FULL); Debug.Log("Glass is " + _currentLookingGlassCup.GetDrinkType()); Debug.Log("Glass is " + _currentLookingGlassCup.GetGlassState()); Debug.Log("This AC is " + currentObject.GetAlcoholContent()); Debug.Log("POURING"); break; case GLASS_STATE.FULL: // Do nothing break; default: // This combination wasn't in chart data. _currentLookingGlassCup.SetDrinkType(DRINK_TYPE.WASTE); break; } } }