public void QueueFishAgain(fish pFish, bool pQueueAgain, bool pRemoveFromList, bool pDestroyNow) { if (!pFish) { return; } int pType = (int)pFish.GetFishType(); Debug.Log(_fishPerTypeSpawned[pType] + " Spawned"); if (pQueueAgain && _fishPerTypeSpawned[pType] > 0) { _totalSpawned -= 1; _fishPerTypeSpawned[pType] -= 1; Debug.Log(_fishPerTypeSpawned[pType] + " After Requed"); } if (pRemoveFromList) { SpawnedFish.Remove(pFish); } if (pDestroyNow && pFish.gameObject) { Destroy(pFish.gameObject); } }
// public override void OnTriggerEnter(Collider other) { if (!_hook || !other) { return; } //Reel the hook in if you touch the floor if (other.gameObject.CompareTag("Floor")) { //The game time is out before this condition can be true, I am going to leave it here just in case /*if (basic.GlobalUI.InTutorial) * { * basic.GlobalUI.ShowHandSwipe(false); * basic.GlobalUI.SwipehandCompleted = true; * }*/ SetState(hook.HookState.Reel); //basic.combo.ClearPreviousCombo(false); //GameObject.Instantiate (basic.HookHit, _hook.HookTip.position, Quaternion.identity); } //On contact with a fish if (other.gameObject.CompareTag("Fish")) { fish theFish = other.gameObject.GetComponent <fish>(); if (!theFish || !theFish.Visible) { return; } theFish.SetState(fish.FishState.FollowHook); GameManager.ShopList.CollectFish((int)theFish.GetFishType()); GameManager.Scorehandler.AddScore(theFish.GetFishType(), true, true); /*if (!basic.GlobalUI.InTutorial) * { * basic.combo.CheckComboProgress(theFish.fishType); * } * if (!basic.Shoppinglist.Introduced) * { * basic.Shoppinglist.Show(true); * basic.Shoppinglist.Introduced = true; * }*/ //basic.Camerahandler.CreateShakePoint(); } if (other.gameObject.CompareTag("Jellyfish")) { Jellyfish theJellyfish = other.gameObject.GetComponent <Jellyfish>(); if (!theJellyfish) { return; } _hook.EnableJellyAttackEffect(); GameManager.Scorehandler.RemoveScore(true); // basic.Camerahandler.CreateShakePoint(); SetState(hook.HookState.Reel); //basic.combo.ClearPreviousCombo(false); //Create a new list maybe //Change animation for the fish and state //Remove fish from list //Destroy fish } if (other.gameObject.CompareTag("Trash")) { trash theTrash = other.gameObject.GetComponent <trash>(); if (!theTrash || !theTrash.Visible) { return; } theTrash.SetState(trash.TrashState.FollowHook); //_hook.TrashOnHook.Add(theTrash); //bool firstTime = basic.Scorehandler.CollectATrashPiece(); //basic.GlobalUI.UpdateOceanProgressBar(firstTime); //basic.Camerahandler.CreateShakePoint(); //The game time is out before this condition can be true, I am going to leave it here just in case /*if (basic.GlobalUI.InTutorial) * { * basic.GlobalUI.ShowHandSwipe(false); * basic.GlobalUI.SwipehandCompleted = true; * }*/ SetState(hook.HookState.Reel); //basic.combo.ClearPreviousCombo(false); } }