private void Start() { exit = FindObjectOfType <Exit>(); flowerManager = FindObjectOfType <FlowerManager>(); player = FindObjectOfType <FloatyGirl>().gameObject; sceneManage = FindObjectOfType <SceneManage>(); }
void Start() { Monetization.Initialize("2943700", true); this.rzabkaGiver = GameObject.Find("RzabaSpawner").GetComponent <RzabaSpawner>(); ZaboPodmieniarka(rzabkaGiver.ProszemDacRzabke(new Vector3(0, 0, 0))); this.flowerManager = new FlowerManager(); this.lootSpawner = GameObject.Find("LootSpawner").GetComponent <LootSpawner>(); this.happyFrogs = new List <GameObject>(); this.currentFrog = GameObject.Find("Frog"); this.modifiers = new List <FlowerModifier>(); Screen.orientation = ScreenOrientation.Portrait; this.wybuch = GameObject.Find("Wybuch").transform.Find("Explosion"); this.wybuch.gameObject.SetActive(false); this.dymek = GameObject.Find("Dymek").transform.Find("Smoke"); this.dymek.gameObject.SetActive(false); this.goToCollectionButton = GameObject.Find("GoToCollectionButton"); this.trzepacz = GameObject.Find("TrzepaczHajsu").GetComponent <TrzepaczHajsu>(); this.trzepacz.rewarder = delegate(bool p) { modifiers.Add(new FlowerModifier(2, 60, p)); }; this.playerResourcesScript = GameObject.Find("PlayerResources").GetComponent <PlayerResourcesScript>(); LoadData(); GameObject.Find("Shop").GetComponent <ShopScript>().itemDatas.FindAll(x => x.isBought).ForEach(x => { modifiers.Add(new FlowerModifier(2, 60, true)); }); }
void Awake() { if (instance) { Debug.Log("다중인스턴스 실행중입니다. 주의하세요"); } instance = this; }
private bool CheckLogroPetalos() { // Comprobamos que todas las flores de ese nivel están siendo regadas if (!flowerManager) { flowerManager = FindObjectOfType <FlowerManager>(); } return(flowerManager.CountFlowerStatus()); }
public static bool GetFlowers() { try { FlowerManager manager = new FlowerManager(); var allClients = manager.GetFlower(null); return(allClients.Count > 0); } catch (Exception) { return(false); } }
// GET: Cart public ActionResult Index() { Customer user = this.getCustomer(); ShoppingCartManager manager = new ShoppingCartManager(); IList <ShoppingCartItem> list = manager.GetItemsByCustomer(user.Id); FlowerManager flowerManager = new FlowerManager(); IList <Flower> flowers = flowerManager.GetFlowers(); foreach (ShoppingCartItem item in list) { item.Flower = flowers.First(f => f.Id == item.FlowerId); } return(View(list)); }
// GET: Order/Details/5 public ActionResult Details(int id) { FlowerOrderManager manager = new FlowerOrderManager(); FlowerOrder model = manager.GetFlowerOrderById(id); IList <Flower> flowers = new FlowerManager().GetFlowers(); model.OrderItems = manager.GetOrderItems(model.Id); foreach (OrderItem orderItem in model.OrderItems) { orderItem.Flower = flowers.First(f => f.Id == orderItem.FlowerId); } return(View(model)); }
public ActionResult Index(string sortField) { IList <Flower> list = new List <Flower>(); FlowerManager manager = new FlowerManager(); list = manager.GetFlower(sortField); ViewBag.sortFieldName = sortField == "Name" ? "Name_desc" : "Name"; ViewBag.sortFieldCountry = sortField == "Country" ? "Country_desc" : "Country"; ViewBag.sortFieldSell_Price = sortField == "Sell_Price" ? "Price_desc" : "Price"; return(View(list)); }
// GET: Vacancy public ActionResult Index(int?fCategory, string fName, string fDescription) { FlowerManager manager = new FlowerManager(); FlowerCategoryManager categoryManager = new FlowerCategoryManager(); IList <Flower> list = manager.FilterFlowers(fCategory, fName, fDescription); IList <FlowerCategory> categories = categoryManager.GetFlowerCategories(); foreach (Flower item in list) { item.FlowerCategory = categories.First(d => d.Id == item.FlowerCategoryId); } ViewBag.fTitle = fName; ViewBag.fDescription = fDescription; ViewBag.fCategory = fCategory; ViewBag.categories = categories; return(View(list)); }
FlowerManager GetClosestAvailableFlower() { FlowerManager bestTarget = null; float closestDistanceSqr = Mathf.Infinity; Vector3 currentPosition = transform.position; foreach (FlowerManager potentialTarget in GameManager.instance.allFlowers) { if (potentialTarget.isDeath) { continue; } Vector3 directionToTarget = potentialTarget.transform.position - currentPosition; float dSqrToTarget = directionToTarget.sqrMagnitude; if (dSqrToTarget < closestDistanceSqr) { closestDistanceSqr = dSqrToTarget; bestTarget = potentialTarget; } } return(bestTarget); }
// Use this for initialization void Start() { windInProgress = 0f; audios = GetComponent<AudioSource>(); fm = GameObject.Find ("Main Camera").GetComponent<FlowerManager> (); }
// Use this for initialization void Start() { audios = GetComponent<AudioSource>(); audios.volume = 0f; isColliding = false; smushMe = false; cam = GameObject.Find ("Main Camera"); fm = cam.GetComponent<FlowerManager> (); }
//public Vector3 axis = Vector3.zero; // Use this for initialization void Start() { grass = GetComponent<Rigidbody2D>(); flower = GameObject.FindWithTag("flower1"); flowersIn = 0; flowerInRotation = Quaternion.Euler (0, 0, 0); cam = GameObject.Find ("Main Camera"); fm = cam.GetComponent<FlowerManager> (); }
public ActionResult Search(string name = "", string country = "", string Sell_Price = "") { FlowerManager manager = new FlowerManager(); return(View("Index", (manager.FlowerFilt(name, country, Sell_Price)))); }
public ActionResult Index(string sortField, string query) { FlowerManager manager = new FlowerManager(); return(View(manager.GetFlower(sortField, query))); }
// Update is called once per frame void Update() { // Health Regeneration Calculation startRegen += Time.deltaTime; if (startRegen > 5) { regen = true; } if (regen == true) { regentimer += Time.deltaTime; if (regentimer > 5) { regentimer = 0; CurrentStamina += 1; } } if (Input.GetKeyDown(KeyCode.Tab)) { selling = true; } if (CurrentStamina > MaxStamina) { CurrentStamina = MaxStamina; } if (selling == false) { if (Input.GetMouseButtonDown(0)) { RaycastHit hit; if (InventoryManager.equippeditem().Equals("Tomato Seed")) { var t_seeds = InventoryManager.Inventory.Find(Toolmanager => Toolmanager.Tooltype == "Tomato Seed"); if (CurrentStamina >= t_seeds.cost) { RaycastHit hitinfo; if (Physics.Raycast(this.transform.position, this.transform.forward, out hitinfo, this.Interactdistance, 1 << LayerMask.NameToLayer("Crops"))) { CropTileClass CropTileComponent = (CropTileClass)hitinfo.collider.gameObject.GetComponent("CropTileClass"); if (CropTileComponent != null) { if (CropTileComponent.plantseed(t_seeds.howmuchtowater, "Tomato")) { if (t_seeds.minustool() == false) { InventoryManager.removetool(); } CurrentStamina -= t_seeds.cost; regen = false; regentimer = 0; startRegen = 0; } } } } } else if (InventoryManager.equippeditem().Equals("Corn Seed")) { var c_seeds = InventoryManager.Inventory.Find(Toolmanager => Toolmanager.Tooltype == "Corn Seed"); if (CurrentStamina >= c_seeds.cost) { RaycastHit hitinfo; if (Physics.Raycast(this.transform.position, this.transform.forward, out hitinfo, this.Interactdistance, 1 << LayerMask.NameToLayer("Crops"))) { CropTileClass CropTileComponent = (CropTileClass)hitinfo.collider.gameObject.GetComponent("CropTileClass"); if (CropTileComponent != null) { if (CropTileComponent.plantseed(c_seeds.howmuchtowater, "Corn")) { if (c_seeds.minustool() == false) { InventoryManager.removetool(); } CurrentStamina -= c_seeds.cost; regen = false; regentimer = 0; startRegen = 0; } } } } } else if (InventoryManager.equippeditem().Equals("Waterbucket")) { var waterbucket = InventoryManager.Inventory.Find(Toolmanager => Toolmanager.Tooltype == "Waterbucket"); if (CurrentStamina >= waterbucket.cost) { RaycastHit hitinfo; if (Physics.Raycast(this.transform.position, this.transform.forward, out hitinfo, this.Interactdistance, 1 << LayerMask.NameToLayer("Crops"))) { CropTileClass CropTileComponent = (CropTileClass)hitinfo.collider.gameObject.GetComponent("CropTileClass"); if (CropTileComponent != null) { CropTileComponent.watercrop(); CurrentStamina -= waterbucket.cost; regen = false; regentimer = 0; startRegen = 0; } } } } else if (InventoryManager.equippeditem().Equals("Waterbucket Lvl 2")) { var waterbucket2 = InventoryManager.Inventory.Find(Toolmanager => Toolmanager.Tooltype == "Waterbucket Lvl 2"); if (CurrentStamina >= waterbucket2.cost) { RaycastHit hitinfo; if (Physics.Raycast(this.transform.position, this.transform.forward, out hitinfo, this.Interactdistance, 1 << LayerMask.NameToLayer("Crops"))) { CropTileClass CropTileComponent = (CropTileClass)hitinfo.collider.gameObject.GetComponent("CropTileClass"); if (CropTileComponent != null) { CropTileComponent.watercrop(); CurrentStamina -= waterbucket2.cost; regen = false; regentimer = 0; startRegen = 0; } } } } else if (InventoryManager.equippeditem().Equals("Hoe")) { var hoe = InventoryManager.Inventory.Find(Toolmanager => Toolmanager.Tooltype == "Hoe"); if (CurrentStamina >= hoe.cost) { RaycastHit hitinfo; if (Physics.Raycast(this.transform.position, this.transform.forward, out hitinfo, this.Interactdistance, 1 << LayerMask.NameToLayer("Crops"))) { CropTileClass CropTileComponent = (CropTileClass)hitinfo.collider.gameObject.GetComponent("CropTileClass"); if (CropTileComponent != null) { CropTileComponent.tillcrop(); CurrentStamina -= hoe.cost; regen = false; regentimer = 0; startRegen = 0; } } } } else if (InventoryManager.equippeditem().Equals("Hoe Lvl 2")) { var hoe2 = InventoryManager.Inventory.Find(Toolmanager => Toolmanager.Tooltype == "Hoe Lvl 2"); if (CurrentStamina >= hoe2.cost) { RaycastHit hitinfo; if (Physics.Raycast(this.transform.position, this.transform.forward, out hitinfo, this.Interactdistance, 1 << LayerMask.NameToLayer("Crops"))) { CropTileClass CropTileComponent = (CropTileClass)hitinfo.collider.gameObject.GetComponent("CropTileClass"); if (CropTileComponent != null) { CropTileComponent.tillcrop(); CurrentStamina -= hoe2.cost; regen = false; regentimer = 0; startRegen = 0; } } } } else if (InventoryManager.equippeditem().Equals("Hands")) { RaycastHit hitinfo; //TO HARVEST CROPS if (Physics.Raycast(this.transform.position, this.transform.forward, out hitinfo, this.Interactdistance, 1 << LayerMask.NameToLayer("Crops"))) { CropTileClass CropTileComponent = (CropTileClass)hitinfo.collider.gameObject.GetComponent("CropTileClass"); if (CropTileComponent != null) { CropTileComponent.harvestcrop(); var takecrop = InventoryManager.Inventory.Find(Toolmanager => Toolmanager.Tooltype == CropTileComponent.cropname); //if(InventoryManager.Inventory.Find(Toolmanager => (Toolmanager.Tooltype == CropTileComponent.cropname)) != new Toolmanager("0", 0, 0, 0, 0)) Debug.Log("inside if statement"); takecrop.addtool(); Debug.Log(takecrop.Tooltype); } } //TO PICK UP FLOWERS else if (Physics.Raycast(this.transform.position, this.transform.forward, out hitinfo, this.Interactdistance, 1 << LayerMask.NameToLayer("Flowers"))) { var flower = InventoryManager.Inventory.Find(Toolmanager => (Toolmanager.Tooltype == "Flower")); flower.addtool(); FlowerManager myFlower = (FlowerManager)hitinfo.collider.gameObject.GetComponent("FlowerManager"); myFlower.DestroyFlower(); } else if (Physics.Raycast(this.transform.position, this.transform.forward, out hitinfo, this.Interactdistance, 1 << LayerMask.NameToLayer("Egg"))) { Egg pickedEgg = (Egg)hitinfo.collider.gameObject.GetComponent("Egg"); pickedEgg.destroyegg(); var egg = InventoryManager.Inventory.Find(Toolmanager => (Toolmanager.Tooltype == "Egg")); egg.addtool(); //InventoryManager.Inventory.Add(new Toolmanager("Egg", 0, 0, 1, 0)); } } else if (InventoryManager.equippeditem().Equals("Tomato")) { var tomato = InventoryManager.Inventory.Find(Toolmanager => Toolmanager.Tooltype == "Tomato"); tomato.minustool(); Debug.Log("EATING A TOMATO"); CurrentStamina += 50; } else if (InventoryManager.equippeditem().Equals("Feed")) { RaycastHit hitinfo; var feed = InventoryManager.Inventory.Find(Toolmanager => Toolmanager.Tooltype == "Feed"); if (Physics.Raycast(this.transform.position, this.transform.forward, out hitinfo, this.Interactdistance, 1 << LayerMask.NameToLayer("Chicken"))) { Debug.Log("Hit chicken"); Chicken chickenComponent = (Chicken)hitinfo.collider.gameObject.GetComponent("Chicken"); chickenComponent.feed(); if (feed.minustool() == false) { InventoryManager.removetool(); } } else if (Physics.Raycast(this.transform.position, this.transform.forward, out hitinfo, this.Interactdistance, 1 << LayerMask.NameToLayer("Cow"))) { Debug.Log("Hit Cow"); Cow cowComponent = (Cow)hitinfo.collider.gameObject.GetComponent("Cow"); cowComponent.feed(); if (feed.minustool() == false) { InventoryManager.removetool(); } } } if (InventoryManager.equippeditem().Equals("Milker")) { RaycastHit hitinfo; if (Physics.Raycast(this.transform.position, this.transform.forward, out hitinfo, this.Interactdistance, 1 << LayerMask.NameToLayer("Cow"))) { Cow cowComponent = (Cow)hitinfo.collider.gameObject.GetComponent("Cow"); int milkNum = cowComponent.milk(); var milk = InventoryManager.Inventory.Find(Toolmanager => (Toolmanager.Tooltype == "Milk")); while (milkNum > 0) { milk.addtool(); milkNum--; } } } } if (Input.GetKeyDown(KeyCode.RightArrow)) //cycle through inventory { InventoryManager.equipnextitem(); this.updateVisibleTool(); } if (Input.GetKeyDown(KeyCode.LeftArrow)) { InventoryManager.equippreviousitem(); this.updateVisibleTool(); } } }
public void SetInstance() { inst = this; }
private void Start() { flowerManager = transform.parent.GetComponent <FlowerManager>(); }