public AbstractTrashState(trash pTrash) { if (!_trash) { _trash = pTrash; } }
public FloatTrashState(trash pTrash, float pSpinsPerSeconds, float pSpinRadius) : base(pTrash) { _spinsPerSecond = pSpinsPerSeconds; _spinRadius = pSpinRadius; _outlineCounter = new counter(0); _spinDirection = UnityEngine.Random.Range(0, 2) == 0 ? 1 : -1; }
public static void AddCollectable(trash pTrash) { if (pTrash) { Trash.Add(pTrash); } }
public void SpawnTrash() { Debug.Log("TrashPieces: " + trashPieces.Length); trashSpawns = new List <Transform>(); GameObject[] arr = GameObject.FindGameObjectsWithTag("TrashSpawn"); for (int i = 0; i < arr.Length; i++) { trashSpawns.Add(arr[i].transform); } Debug.Log("TrashSpawns: " + trashSpawns.Count); int spawnCount = amountOfTrashOnSeafloor; if (amountOfTrashOnSeafloor > trashSpawns.Count) { Debug.Log("WARNING: Trying to spawn more pieces of trash than available spawn points, some will not be instantiated."); spawnCount = trashSpawns.Count; } for (int i = 0; i < spawnCount; i++) { int spawnNumber = Random.Range(0, trashSpawns.Count); trash newTrash = Instantiate(trashPieces[Random.Range(0, trashPieces.Length)], trashSpawns[spawnNumber].transform.position, Quaternion.identity).GetComponent <trash>(); //newTrash.transform.position = trashSpawns[spawnNumber].transform.position; newTrash.gameObject.SetActive(true); trashSpawns.Remove(trashSpawns[spawnNumber]); basic.AddCollectable(newTrash); } basic.Scorehandler.SetTotalNumberOfTrashPieces(spawnCount); }
private void DoScan(trash pCollectable) { if (pCollectable == null) { return; } bool visible = Vector3.Dot(-_radar.gameObject.transform.up, (pCollectable.transform.position - _radar.transform.position).normalized) >= _radarAngle; if (visible) { pCollectable.Reveal(_fadeOutDuration, _collectableStaysVisibleRange); } else { pCollectable.Hide(); } }
public FollowHookTrashState(trash pTrash) : base(pTrash) { }
public NoneTrashState(trash pTrash) : base(pTrash) { }
public PiledUpTrashState(trash pTrash) : base(pTrash) { }
// 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); } }