示例#1
0
    public void EnterArea(GameObject interactiveObject)
    {
        Debug.Log("SU PUTO NOMBRE" + interactiveObject);
        String name = interactiveObject.name;

        switch (name)
        {
        //case "Vomit(Clone)":

        /* Debug.Log("ENTROENVOMITO");
         * if (charStats.hasMop)
         * {
         *   audioSource.PlayOneShot(sfxCleaning);
         *   UnityEngine.Debug.Log("Cleaning the mess");
         *   //Destroy(interactiveObject);
         *   if (onMop2Vomit != null)
         *       onMop2Vomit();
         * }*/

        /*else
         *  chanceResbalar()*/
        //break;

        /*else
         *      chanceTortazo()*/

        case "wc":
            if (charStats.hasMop)
            {
                AudioSource.PlayClipAtPoint(sfxDropMop, transform.position);
                UnityEngine.Debug.Log("Droping Mop");
                if (onDropMop != null)
                {
                    onDropMop();
                }
            }
            else
            {
                if (!charStats.busy)
                {
                    AudioSource.PlayClipAtPoint(sfxPickMop, transform.position);
                    UnityEngine.Debug.Log("Picking the Mop");
                    if (onGetMop != null)
                    {
                        onGetMop();
                    }
                }
                else
                {
                    //ANIM BOCADILLO OBJETO QUE YA TENGO
                    //metodo getItem de charStats
                }
            }

            charStats.ChangeMop();
            // resetMop?
            break;

        case "Cousin":

            if (!charStats.busy)
            {
                cousin.StartFollowingPlayer();
                charStats.ChangeCousin();
                if (onGetCousin != null)
                {
                    onGetCousin();
                }
            }
            break;

        case "fridge":
            if (charStats.hasSixPack)
            {
                //onSixPack2Fridge();
                AudioSource.PlayClipAtPoint(sfxDeliverBeer, transform.position);
                UnityEngine.Debug.Log("SixPack Delivered!");
                if (onSixPack2Fridge != null)
                {
                    onSixPack2Fridge();
                    Debug.Log("ASD");
                }

                charStats.ChangeSixPack();
                //upgradeDrinkBar() ?
            }
            else
            {
                if (charStats.hasDrink)
                {
                    AudioSource.PlayClipAtPoint(sfxTakeBeer, transform.position);
                    UnityEngine.Debug.Log("Droping the Drink in the Fridge");
                    if (onDropDrink != null)
                    {
                        onDropDrink();
                    }
                }
                else
                {
                    AudioSource.PlayClipAtPoint(sfxTakeBeer, transform.position);
                    UnityEngine.Debug.Log("Cracking a cold one");
                    if (onGetDrink != null)
                    {
                        onGetDrink();
                    }
                }
                charStats.ChangeDrink();
            }
            break;

        case "storage":
            if (charStats.hasSixPack)
            {
                if (onDropSixPack != null)
                {
                    onDropSixPack();
                }
            }
            else
            {
                if (!charStats.busy)
                {
                    AudioSource.PlayClipAtPoint(sfxTakeSixPack, transform.position);
                    UnityEngine.Debug.Log("Picking a SixPack");
                    if (onGetSixPack != null)
                    {
                        onGetSixPack();
                    }
                }
                else
                {
                    //BOCADILLO QUE OBJETO LLEVAS
                }
            }
            charStats.ChangeSixPack();
            break;

        case "dj":
            if (charStats.hasDrink)
            {
                UnityEngine.Debug.Log("Hydrating the DJ");
                if (onBeer2Dj != null)
                {
                    onBeer2Dj();
                }
                charStats.ChangeDrink();
            }
            //upgradeDjBar?
            break;

        case "danceFloor":
            // if fever?
            if (!charStats.busy)
            {
                UnityEngine.Debug.Log("Fever!");
                if (onFever != null)
                {
                    onFever();
                }
            }

            break;
        }
    }
示例#2
0
    private void Interaction(String name)
    {
        switch (name)
        {
        case "vomit":
            /*
             * if (charStats.hasMop)
             * cleanVomit()
             * upgradeCleanBar() ?
             * else
             *  chanceResbalar()*/
            break;

        case "fight":
            /*
             * if (charStats.hasCousin)
             *  solveFight()
             *  upgradeCopsBar() ?
             * else
             *  chanceTortazo()
             */
            break;

        case "wc":
            charStats.ChangeMop();
            // resetMop?
            break;

        case "cousin":
            charStats.ChangeCousin();
            break;

        case "fridge":
            if (charStats.hasSixPack)
            {
                UnityEngine.Debug.Log("UPGRADE Drink");
                charStats.ChangeSixPack();
                //upgradeDrinkBar() ?
            }
            else
            {
                charStats.ChangeDrink();
            }
            break;

        case "storage":
            charStats.ChangeSixPack();
            break;

        case "dj":
            if (charStats.hasDrink)
            {
                charStats.ChangeDrink();
                UnityEngine.Debug.Log("UPGRADE DJ");
            }
            //upgradeDjBar?
            break;

        case "danceFloor":
            // if fever?
            charStats.ChangeDanceFloor();
            break;
        }
    }