Ejemplo n.º 1
0
    //void Awake()

    void Awake()
    {
        damegeTextManager      = GameObject.FindGameObjectWithTag("DamageText").GetComponent <DamageTextManager>();
        smallFood_Setting      = GameObject.FindGameObjectWithTag("SmallMenu_Setting").GetComponent <SmallFood_Setting>();
        smallStageMenu_Setting = GameObject.FindGameObjectWithTag("SmallStageMenu_Setting").GetComponent <SmallStageMenu_Setting>();
        mainFood_Setting       = GameObject.FindGameObjectWithTag("MainFood_Setting").GetComponent <MainFood_Setting>();
        combo_system           = GameObject.FindGameObjectWithTag("Combo_System").GetComponent <Combo_System>();
        stage     = GameObject.FindGameObjectWithTag("Stage").GetComponent <StageManager>();
        layerMask = LayerMask.GetMask(DishLayer, SkillLayer);
        startSmallFoodAnimation = GameObject.FindGameObjectWithTag("StartSmallFoodPosition").GetComponent <StartSmallFoodAnimation>();
        mainSpoonAnimation      = GameObject.FindGameObjectWithTag("MainSpoon").GetComponent <MainSpoonAnimation>();
        mainChopsticAnimation   = GameObject.FindGameObjectWithTag("MainChopstic").GetComponent <MainChopsticAnimation>();
        SmallSpoonAnimation     = GameObject.FindGameObjectWithTag("SmallSpoonAnimation").GetComponent <SmallSpoonAnimation>();
        mainForksAnimation      = GameObject.FindGameObjectWithTag("MainForks").GetComponent <MainForksAnimation>();
        mainKnifeAnimation      = GameObject.FindGameObjectWithTag("MainKnife").GetComponent <MainKnifeAnimation>();
        blueDishGather          = GameObject.FindGameObjectWithTag("Blue_Dish_Gather").GetComponent <BlueDishGather>();
        yellowDishGather        = GameObject.FindGameObjectWithTag("Yellow_Dish_Gather").GetComponent <YellowDishGather>();
        greenDishGather         = GameObject.FindGameObjectWithTag("Green_Dish_Gather").GetComponent <GreenDishGather>();
        redDishGather           = GameObject.FindGameObjectWithTag("Red_Dish_Gather").GetComponent <RedDishGather>();
        playerAnimation         = GameObject.FindGameObjectWithTag("PlayerRender").GetComponent <PlayerAnimation>();
        smallChopsticAnimation  = GameObject.FindGameObjectWithTag("SmallChopstic").GetComponent <SmallChopsticAnimation>();
        smallForksAnimation     = GameObject.FindGameObjectWithTag("SmallForks").GetComponent <SmallForksAnimation>();
        smallKnifeAnimation     = GameObject.FindGameObjectWithTag("SmallKnife").GetComponent <SmallKnifeAnimation>();
        mainCamara = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <MainCamara>();
        stt        = GameObject.FindGameObjectWithTag("STI").GetComponent <SustainmentTime>();
    }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     mainFood_Setting       = GameObject.FindGameObjectWithTag("MainFood_Setting").GetComponent <MainFood_Setting>();
     smallStageMenu_Setting = GameObject.FindGameObjectWithTag("SmallStageMenu_Setting").GetComponent <SmallStageMenu_Setting>();
     player            = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Ctrl_PC>();
     damegeTextManager = GameObject.FindGameObjectWithTag("DamageText").GetComponent <DamageTextManager>();
 }
Ejemplo n.º 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);
    }
Ejemplo n.º 4
0
    void Start()
    {
        smallStageMenu_Setting = GameObject.FindGameObjectWithTag("SmallStageMenu_Setting").GetComponent <SmallStageMenu_Setting>();
        mainFood_Setting       = GameObject.FindGameObjectWithTag("MainFood_Setting").GetComponent <MainFood_Setting>();
        randomMax = mainStageImage.Length;

        if (mainStageCount == 1)
        {
            randomStage = Random.Range(1, randomMax);
            mainStageSlot2.gameObject.GetComponent <Image>().sprite = mainStageImage[randomStage];
            randomStage = Random.Range(1, randomMax);
            mainStageSlot3.gameObject.GetComponent <Image>().sprite = mainStageImage[randomStage];
            mainStageText2.text = mainStageCount.ToString();
            mainStageText3.text = (mainStageCount + 1).ToString();
        }
        else
        {
            randomStage = Random.Range(1, randomMax);
            mainStageSlot1.gameObject.GetComponent <Image>().sprite = mainStageImage[randomStage];
            randomStage = Random.Range(1, randomMax);
            mainStageSlot2.gameObject.GetComponent <Image>().sprite = mainStageImage[randomStage];
            randomStage = Random.Range(1, randomMax);
            mainStageSlot3.gameObject.GetComponent <Image>().sprite = mainStageImage[randomStage];
            mainStageText1.text = (mainStageCount - 1).ToString();
            mainStageText2.text = mainStageCount.ToString();
            mainStageText3.text = (mainStageCount + 1).ToString();
        }
        smallstageText.text = smallstageCount.ToString() + " / 10";
    }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        player                 = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Ctrl_PC>();
        mainFood_Setting       = GameObject.FindGameObjectWithTag("MainFood_Setting").GetComponent <MainFood_Setting>();
        smallStageMenu_Setting = GameObject.FindGameObjectWithTag("SmallStageMenu_Setting").GetComponent <SmallStageMenu_Setting>();
        stageManager           = GameObject.FindGameObjectWithTag("Stage").GetComponent <StageManager>();
        damageText             = GameObject.FindGameObjectWithTag("DamageText").GetComponent <DamageTextManager>();

        maxHP     = stageManager.mainStageHp;
        currentHp = stageManager.mainStageHp;
    }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        smallStageMenu_Collection = GameObject.FindGameObjectWithTag("SmallStageMenu_Collection").GetComponent <SmallStageMenu_Collection>();
        mainFood_Setting          = GameObject.FindGameObjectWithTag("MainFood_Setting").GetComponent <MainFood_Setting>();
        stageManager   = GameObject.FindGameObjectWithTag("Stage").GetComponent <StageManager>();
        smallStageMenu = GameObject.FindGameObjectWithTag("SmallStageFood").GetComponent <SmallStageMenu>();
        randomindexMax = smallStageMenu_Collection.smallStageFood_Collection.Length;

        StartSmallStageMenuSetting();

        smallStageFood.GetComponentInChildren <SmallStageMenu>().Canvas_UI_Hp_Bar.fillAmount = smallStageFood.GetComponentInChildren <SmallStageMenu>().currentHp / smallStageFood.GetComponentInChildren <SmallStageMenu>().maxHP;
        //smallStageFood.GetComponentInChildren<SmallStageMenu>().hp_Text.text = smallStageFood.GetComponentInChildren<SmallStageMenu>().currentHp.ToString("N1") +" HP";
        smallStageFood.GetComponentInChildren <SmallStageMenu>().hp_Text.text       = CountModule(smallStageFood.GetComponentInChildren <SmallStageMenu>().currentHp) + " HP";
        smallStageFood.GetComponentInChildren <SmallStageMenu>().smallMenuName.text = smallStageFood.GetComponentInChildren <SmallStageMenu>().Name_String;
    }
Ejemplo n.º 7
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>();
 }