示例#1
0
 public void AttackMenu()
 {
     if (player.mainStage == false)
     {
         if (Random.Range(1, 101) <= criticalInt)
         {
             damegeTextManager.ciriticalMode = true;
             smallStageMenu_Setting.GetComponentInChildren <SmallStageMenu>().TheDishesDamege(power * 2);
             damegeTextManager.TheDishesDamage(power * 2);
         }
         else
         {
             smallStageMenu_Setting.GetComponentInChildren <SmallStageMenu>().TheDishesDamege(power);
             damegeTextManager.TheDishesDamage(power);
         }
         GetComponent <AudioSource>().clip = mainKnifeSound;
         GetComponent <AudioSource>().Play();
     }
     else
     {
         if (Random.Range(1, 101) <= criticalInt)
         {
             damegeTextManager.ciriticalMode = true;
             mainFood_Setting.GetComponentInChildren <MainFood>().TheDishesDamege(power * 2);
             damegeTextManager.TheDishesDamage(power * 2);
         }
         else
         {
             mainFood_Setting.GetComponentInChildren <MainFood>().TheDishesDamege(power);
             damegeTextManager.TheDishesDamage(power);
         }
         GetComponent <AudioSource>().clip = mainKnifeSound;
         GetComponent <AudioSource>().Play();
     }
 }
示例#2
0
    public void yellowDishGatherPlus()
    {
        if (index < 30)
        {
            yellowDishGather[index] = Instantiate(Resources.Load("Yellow_Gather"), Vector3.zero, Quaternion.identity) as GameObject;
            yellowDishGather[index].transform.SetParent(yellowDishTransfrom[index].transform, false);
            yellowDishGather[index].transform.position = yellowDishTransfrom[index].transform.position;

            index++;
        }

        else
        {
            for (int i = 0; i < yellowDishGather.Length; i++)
            {
                Destroy(yellowDishGather[i]);
            }
            if (player.mainStage == false)
            {
                smallStageMenu_Setting.GetComponentInChildren <SmallStageMenu>().Damage((player.power) * 3);
            }
            else
            {
                mainFood_Setting.GetComponentInChildren <MainFood>().Damage((player.power) * 3);
            }

            index = 0;

            GameObject Effect = Instantiate(effect, Vector3.zero, Quaternion.identity) as GameObject;
            Effect.transform.SetParent(effectTransform.transform, false);
            Effect.transform.position = effectTransform.transform.position;
        }
    }
示例#3
0
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Ctrl_PC>();
        smallStageMenu_Setting = GameObject.FindGameObjectWithTag("SmallStageMenu_Setting").GetComponent <SmallStageMenu_Setting>();
        mainFood_Setting       = GameObject.FindGameObjectWithTag("MainFood_Setting").GetComponent <MainFood_Setting>();

        if (player.mainStage == false)
        {
            text.text = CountModule(smallStageMenu_Setting.GetComponentInChildren <SmallStageMenu>().damage);
        }
        else
        {
            text.text = CountModule(mainFood_Setting.GetComponentInChildren <MainFood>().damage);
        }

        animationNumber = Random.Range(1, 3);
        if (animationNumber == 1)
        {
            this.GetComponent <Animator>().Rebind();
            this.GetComponent <Animator>().Play("Attack1");
        }
        if (animationNumber == 2)
        {
            this.GetComponent <Animator>().Rebind();
            this.GetComponent <Animator>().Play("Attack2");
        }

        Destroy(this.gameObject, 0.7f);
    }
示例#4
0
    public void Combo_Mode()
    {
        if (ps == PlayerState.Combo)
        {
            if (mainStage == false)
            {
                if (Random.Range(1, 101) <= criticalInt)
                {
                    damegeTextManager.ciriticalMode = true;
                    smallStageMenu_Setting.GetComponentInChildren <SmallStageMenu>().Damage(power * 2);
                }
                else
                {
                    smallStageMenu_Setting.GetComponentInChildren <SmallStageMenu>().Damage(power);
                }
            }
            else
            {
                if (Random.Range(1, 101) <= criticalInt)
                {
                    damegeTextManager.ciriticalMode = true;
                    mainFood_Setting.GetComponentInChildren <MainFood>().Damage(power * 2);
                }
                else
                {
                    mainFood_Setting.GetComponentInChildren <MainFood>().Damage(power);
                }
            }
            Food_Shot();
            playerAnimation.SuperModeAnimation();
            Destroy(smallFood_Setting.smallFood_Index[0]);
            Destroy(firstDishPoint);
            combo_Count += 1;

            GameObject menuEffect = Instantiate(menu_Effect, Vector3.zero, Quaternion.identity) as GameObject;
            menuEffect.transform.SetParent(eat_Effect1.transform, false);
            menuEffect.transform.position = eat_Effect1.transform.position;

            GameObject eatEffect = Instantiate(eat_Effect, Vector3.zero, Quaternion.identity) as GameObject;
            eatEffect.transform.SetParent(eat_Transform.transform, false);
            eatEffect.transform.position = eat_Transform.transform.position;

            int randomGold = Random.Range(stage.mainStageCount, stage.mainStageCount + stage.mainStageCount);
            if (goldGain == true)
            {
                randomGold = randomGold * 2;
            }
            else
            {
                randomGold = randomGold * 1;
            }
            gold          = gold + (randomGold * 2);
            goldText.text = CountModule(gold);
            GetComponent <AudioSource>().clip = eat_Sound;
            GetComponent <AudioSource>().Play();

            combo_system.Combo_Mode();
        }
    }
示例#5
0
    public void SmallStageSetting()
    {
        if (mainStageCount == 1)
        {
            smallStageMenu_Setting.GetComponentInChildren <SmallStageMenu>().maxHP     = smallStageHp;
            smallStageMenu_Setting.GetComponentInChildren <SmallStageMenu>().currentHp = smallStageHp;

            smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().Canvas_UI_Hp_Bar.fillAmount = smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().currentHp / smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().maxHP;
            //smallStageMenu_Setting.smallStageFood.GetComponentInChildren<SmallStageMenu>().hp_Text.text = smallStageMenu_Setting.smallStageFood.GetComponentInChildren<SmallStageMenu>().currentHp.ToString("N1") + " HP";
            smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().hp_Text.text       = CountModule(smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().currentHp) + " HP";
            smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().smallMenuName.text = smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().Name_String;
        }
        smallStageHp = smallStageHp * 1.62f;
        smallStageMenu_Setting.GetComponentInChildren <SmallStageMenu>().maxHP     = smallStageHp;
        smallStageMenu_Setting.GetComponentInChildren <SmallStageMenu>().currentHp = smallStageHp;

        smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().Canvas_UI_Hp_Bar.fillAmount = smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().currentHp / smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().maxHP;
        //smallStageMenu_Setting.smallStageFood.GetComponentInChildren<SmallStageMenu>().hp_Text.text = smallStageMenu_Setting.smallStageFood.GetComponentInChildren<SmallStageMenu>().currentHp.ToString("N1") + "HP";
        smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().hp_Text.text       = CountModule(smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().currentHp) + " HP";
        smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().smallMenuName.text = smallStageMenu_Setting.smallStageFood.GetComponentInChildren <SmallStageMenu>().Name_String;
    }
示例#6
0
 public void Skill2Animation2()
 {
     if (mainFood_Setting.main_Food == null)
     {
         smallStageMenu_Setting.GetComponentInChildren <SmallStageMenu>().Damage((player.power) * 50);
         this.gameObject.GetComponent <Animator> ().Rebind();
         this.gameObject.SetActive(false);
     }
     else
     {
         mainFood_Setting.GetComponentInChildren <MainFood>().Damage((player.power) * 50);
         this.gameObject.GetComponent <Animator> ().Rebind();
         this.gameObject.SetActive(false);
     }
 }