//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>(); }
public void Food_Shot() { if (smallFood_Setting.smallFood_Index[0].layer == 12) { //mainKnifeAnimation.MainSpoonAnimationStart(); redDishGather.redDishGatherPlus(); SmallSpoonAnimation.SmallSpoonAttackAnimation(); //Debug.Log("스몰데미지="+ SmallSpoonAnimation.smallPower); GameObject shoot = Instantiate(Resources.Load("SmallFood_Red_Dish_Shoot"), Vector3.zero, Quaternion.identity) as GameObject; shoot.transform.SetParent(eat_Transform.transform, false); shoot.transform.position = eat_Transform.transform.position; iTween.MoveTo(shoot, iTween.Hash("path", iTweenPath.GetPath("Red_Fly"), "time", 1)); //Destroy(); GameObject dishEffect = Instantiate(red_Dish_Effect, Vector3.zero, Quaternion.identity) as GameObject; dishEffect.transform.SetParent(dish_Effect2.transform, false); dishEffect.transform.position = dish_Effect2.transform.position; smallFood_Setting = GameObject.FindGameObjectWithTag("SmallMenu_Setting").GetComponent <SmallFood_Setting>(); } else if (smallFood_Setting.smallFood_Index[0].layer == 11) { //mainChopsticAnimation.MainSpoonAnimationStart(); yellowDishGather.yellowDishGatherPlus(); smallChopsticAnimation.SmallChopsticAttackAnimation(); GameObject shoot = Instantiate(Resources.Load("SmallFood_Yellow_Dish_Shoot"), Vector3.zero, Quaternion.identity) as GameObject; shoot.transform.SetParent(eat_Transform.transform, false); shoot.transform.position = eat_Transform.transform.position; GameObject dishEffect = Instantiate(yellow_Dish_Effect, Vector3.zero, Quaternion.identity) as GameObject; dishEffect.transform.SetParent(dish_Effect3.transform, false); dishEffect.transform.position = dish_Effect3.transform.position; iTween.MoveTo(shoot, iTween.Hash("path", iTweenPath.GetPath("Yellow_Fly"), "time", 1)); } else if (smallFood_Setting.smallFood_Index[0].layer == 10) { //mainForksAnimation.MainSpoonAnimationStart(); greenDishGather.greenDishGatherPlus(); smallForksAnimation.SmallForksAttackAnimation(); GameObject shoot = Instantiate(Resources.Load("SmallFood_Green_Dish_Shoot"), Vector3.zero, Quaternion.identity) as GameObject; shoot.transform.SetParent(eat_Transform.transform, false); shoot.transform.position = eat_Transform.transform.position; GameObject dishEffect = Instantiate(green_Dish_Effect, Vector3.zero, Quaternion.identity) as GameObject; dishEffect.transform.SetParent(dish_Effect4.transform, false); dishEffect.transform.position = dish_Effect4.transform.position; iTween.MoveTo(shoot, iTween.Hash("path", iTweenPath.GetPath("Green_Fly"), "time", 1)); } else if (smallFood_Setting.smallFood_Index[0].layer == 9) { smallKnifeAnimation.SmallKnifeAttackAnimation(); //mainSpoonAnimation.MainSpoonAnimationStart(); blueDishGather.blueDishGatherPlus(); GameObject shoot = Instantiate(Resources.Load("SmallFood_Blue_Dish_Shoot"), Vector3.zero, Quaternion.identity) as GameObject; shoot.transform.SetParent(eat_Transform.transform, false); shoot.transform.position = eat_Transform.transform.position; GameObject dishEffect = Instantiate(blue_Dish_Effect, Vector3.zero, Quaternion.identity) as GameObject; dishEffect.transform.SetParent(dish_Effect1.transform, false); dishEffect.transform.position = dish_Effect1.transform.position; iTween.MoveTo(shoot, iTween.Hash("path", iTweenPath.GetPath("Blue_Fly"), "time", 1)); } }
// Use this for initialization void Start() { smallFood_Setting = GameObject.FindGameObjectWithTag("SmallMenu_Setting").GetComponent <SmallFood_Setting>(); }