void Plow() { overlay.sprite = null; FxManager.PlayMusic("PlowFx"); needsPlowing = false; //local data record DataRecord.AddEvents(2, this.gameObject.name); }
public void PopFishingGame() { FxManager.PlayMusic("FishingFx"); canInteract = false; fishingGame.SetActive(true); PlayerMovement.canMove = false; GetFishSprite(); //local data record DataRecord.AddEvents(6, "Fishing"); }
void PlantCrop(Crop c, PlayerInteraction player) { if (c.asset.cropsType == CropsType.Strawberries) { if (Player.LocalPlayerInstance.GetComponent <Tool>().seeds[0].amount > 0) { //string name = crops[0].gameObject.name; //temp = PhotonNetwork.InstantiateSceneObject(name, this.transform.position, Quaternion.identity); temp = Instantiate(crops[0], this.transform.position, Quaternion.identity); temp.transform.SetParent(this.transform); temp.transform.position = new Vector2(this.transform.position.x, this.transform.position.y); temp.GetComponent <CropTest>().planted = true; Player.LocalPlayerInstance.GetComponent <Tool>().seeds[0].amount--; } else { Debug.Log("Not enough seed"); } } else if (c.asset.cropsType == CropsType.Potatoes) { if (Player.LocalPlayerInstance.GetComponent <Tool>().seeds[1].amount > 0) { temp = Instantiate(crops[1], this.transform.position, Quaternion.identity); temp.transform.SetParent(this.transform); temp.transform.position = new Vector2(this.transform.position.x, this.transform.position.y); temp.GetComponent <CropTest>().planted = true; Player.LocalPlayerInstance.GetComponent <Tool>().seeds[1].amount--; } else { Debug.Log("Not enough seed"); } } else if (c.asset.cropsType == CropsType.Pumpkins) { if (Player.LocalPlayerInstance.GetComponent <Tool>().seeds[2].amount > 0) { temp = Instantiate(crops[2], this.transform.position, Quaternion.identity); temp.transform.SetParent(this.transform); temp.transform.position = new Vector2(this.transform.position.x, this.transform.position.y); temp.GetComponent <CropTest>().planted = true; Player.LocalPlayerInstance.GetComponent <Tool>().seeds[2].amount--; } else { Debug.Log("Not enough seed"); } } FxManager.PlayMusic("PlantFx"); }
void UpdateSFX() { if (direction != Vector2.zero) { if (FxManager.instance.GetComponent <AudioSource>().isPlaying == false) { FxManager.PlayMusic("WalkFx"); } } else { FxManager.StopMusic("WalkFx"); } }
public void SetIcon(Sprite s) { icon.sprite = s; if (s == null) { iconBoxAnim.SetBool("Enable", false); FxManager.StopMusic("PickUpFx"); } else if (s != null) { iconBoxAnim.SetBool("Enable", true); if (!recorded && playerIconBox) { FxManager.PlayMusic("PickUpFx"); recorded = true; } } }
void WaterCrops() { if (canInteract && cropState == CropStateTest.Delayed) { if ((Input.GetKeyDown(KeyCode.Mouse0)) && HotKey.canUse && HotKey.canWater) { WaterCan.curFill -= 1; waterIndicator.SetActive(false); FxManager.PlayMusic("WaterFx"); watered = true; canInteract = false; //For tutorial if (!TutorialManager.doneTutorial) { tutorial.waterCount += 1; } //local data record DataRecord.AddEvents(4, this.gameObject.name); } } }