Exemplo n.º 1
0
 private void spawnSmall()
 {
     small.Interval = 5000;
     small.Tick    += (s, e) =>
     {
         int        move   = r.Next(1, 3);
         fish       ftemp  = new fish("small");
         PictureBox fishPb = new PictureBox();
         if (move == 1)
         {
             fishPb.Location = new Point(0, r.Next(0, this.Height - 100));
         }
         else
         {
             fishPb.Location = new Point(this.Width, r.Next(0, this.Height - 100));
         }
         fishPb.Size     = new Size(50, 50);
         fishPb.Image    = Image.FromFile("images/small.jpg");
         fishPb.SizeMode = PictureBoxSizeMode.StretchImage;
         fishMove(fishPb, move);
         foodPb.Add(fishPb);
         dbfood.Add(ftemp);
         this.Controls.Add(fishPb);
     };
     small.Start();
 }
Exemplo n.º 2
0
    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);
        }
    }
Exemplo n.º 3
0
 public static void AddCollectable(fish pFish)
 {
     if (pFish)
     {
         Fish.Add(pFish);
     }
 }
Exemplo n.º 4
0
    public IEnumerator FishDisplayEnumerator(fish fish)
    {
        testEnable(fish);
        yield return(new WaitForSeconds(3));

        disableDisplay();
    }
 public AbstractFishState(fish pFish)
 {
     if (!_fish)
     {
         _fish = pFish;
     }
 }
Exemplo n.º 6
0
 private void startUp()
 {
     playerPb.Size     = new Size(75, 50);
     playerPb.Location = new Point(500, 300);
     playerPb.SizeMode = PictureBoxSizeMode.StretchImage;
     player            = new fish(playerPb.Location.X, playerPb.Location.Y);
 }
 void OnTriggerExit(Collider collider)
 {
     if (collider.gameObject.CompareTag("Fish"))
     {
         fish      _fish = collider.gameObject.GetComponent <fish>();
         Rigidbody _rb   = _fish.GetComponent <Rigidbody>();
         Debug.Log("dsadsadsa");
     }
 }
Exemplo n.º 8
0
 public void GetFish(string biome)
 {
     //if (biome == null) {
     //    biome = "Normal"; // Error stopper.
     //}
     rarityOfFishRanges(biome);                                                                    //Gets the percentage values for the rarity chance of each fish rarity for each biome.
     RewardFish = pickFish(pickBiome(biome));
     Debug.Log("you got the fish " + RewardFish.fishName + " from biome " + RewardFish.fishBiome); // First, it gets the array that matches the inputted biome, then uses that array to select a fish based on the percentage values from rarityOfFishRanges.
     StartCoroutine(GameObject.Find("Fish_Display").GetComponent <fishDisplay>().FishDisplayEnumerator(RewardFish));
 }
Exemplo n.º 9
0
    // Start is called before the first frame update
    void Start()
    {
        gameState  = GameState.GetInstance();
        speed      = Random.Range(minSpeed, maxSpeed);
        fishScript = GameObject.FindGameObjectWithTag("fish").GetComponent <fish>();
        //string a = GameObject.FindGameObjectWithTag("fishNumberText").GetComponentInChildren<TMP_Text>().text.ToString();
        //fishNum = int.Parse(a);

        Level currentLevel = LevelsDescription.getLevelDescription(gameState.getCurrentLevel());

        fishNum = currentLevel.getFishTargetNumber();
    }
Exemplo n.º 10
0
    private void DoScan(fish 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);
        }
    }
Exemplo n.º 11
0
    // Use this for initialization
    void Start()
    {
        //フレームレート
        Application.targetFrameRate = 60;

        //マウスカーソルの非表示
        Cursor.visible = false;

        //魚の生成
        for (int k = 0; k < 3; k++)
        {
            for (int j = 0; j < WorldData.Fish.Count; j++)
            {
                GameObject Flock = Instantiate(FlockPrefab);

                for (int i = 0; i < WorldData.FishNum; i++)
                {
                    GameObject Boid = Instantiate(WorldData.Fish[j].Prefab);
                    Boid.transform.SetParent(Flock.transform);

                    Boid b = Boid.GetComponent <Boid>();
                    b.SetMaxSpeed(WorldData.Fish[j].MaxSpeed);
                    b.SetWeights(WorldData.Fish[j].Weights);
                    b.SetDesiredSeparate(WorldData.Fish[j].DesiredSeparate);
                    b.SetNeighborDist(WorldData.Fish[j].NeighborDist);
                    b.SetField(Field);

                    fish Fish = Boid.GetComponent <fish>();
                    Fish.SetfinSpeed(Random.Range(0.5f, 1.0f));
                    Fish.SetCycleOffset(Random.Range(0.1f, 1.0f));
                    Fish.SetMaterialFin(WorldData.Fish[j].FinColor);
                    Fish.SetMaterialBody(WorldData.Fish[j].BodyColor);

                    Transform FishBody = Boid.GetComponent <Transform>();
                    FishBody.localScale = new Vector3(1, 1, 1) * Random.Range(3.0f, 7.0f);

                    Vector3 fp = Field.GetPosition();

                    FishBody.localPosition = new Vector3(0, 0, 0);

                    Flock.GetComponent <Flock>().AddBoid(Boid);
                }

                Flocks.Add(Flock.GetComponent <Flock>());
            }
        }

        IEnumerator StandByCoRoutine = WaitLeapHandCoRoutine();

        StartCoroutine(StandByCoRoutine);
    }
Exemplo n.º 12
0
    static void Main(string[] args)
    {
        fish shark = new fish();

        shark.size   = "large";
        shark.lfType = "Fish";
        shark.name   = "Jaws";
        Console.WriteLine(shark.name);
        human me = new human();

        me.legs   = 2;
        me.lfType = "Human";
        me.name   = "Paul";
        Console.WriteLine(me.name);
    }
Exemplo n.º 13
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetButtonUp("Fire2"))
        {
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

            var hits = Physics.RaycastAll(ray);
            foreach (var hit in hits)
            {
                Transform objectHit = hit.transform;
                fish      theFish   = objectHit.gameObject.GetComponent <fish>();
                if (theFish != null)
                {
                    Destroy(theFish.gameObject);
                }
            }
        }
    }
Exemplo n.º 14
0
 private void spawnHeart()
 {
     heart.Interval = 60000;
     heart.Tick    += (s, e) =>
     {
         int        x      = r.Next(0, this.Width - 100);
         int        y      = r.Next(0, this.Height - 100);
         fish       ftemp  = new fish("powerup");
         PictureBox fishPb = new PictureBox();
         fishPb.Location = new Point(x, y);
         fishPb.Size     = new Size(50, 50);
         fishPb.Image    = Image.FromFile("images/heart.png");
         fishPb.SizeMode = PictureBoxSizeMode.StretchImage;
         foodPb.Add(fishPb);
         dbfood.Add(ftemp);
         this.Controls.Add(fishPb);
     };
     heart.Start();
 }
Exemplo n.º 15
0
 private void spawnWhale()
 {
     whale.Interval = 20000;
     whale.Tick    += (s, e) =>
     {
         int        x      = this.Width;
         int        y      = r.Next(0, this.Height - 100);
         fish       ftemp  = new fish("whale");
         PictureBox fishPb = new PictureBox();
         fishPb.Location = new Point(x, y);
         fishPb.Size     = new Size(200, 150);
         fishPb.Image    = Image.FromFile("images/whale.jpg");
         fishPb.SizeMode = PictureBoxSizeMode.StretchImage;
         whaleMove(fishPb);
         foodPb.Add(fishPb);
         dbfood.Add(ftemp);
         this.Controls.Add(fishPb);
     };
     whale.Start();
 }
Exemplo n.º 16
0
 void OnTriggerEnter(Collider collider)
 {
     if (collider.gameObject.CompareTag("Fish"))
     {
         //collider.gameObject.GetComponent<MeshCollider>().isTrigger = true;
         fish      _fish = collider.gameObject.GetComponent <fish>();
         Rigidbody _rb   = _fish.GetComponent <Rigidbody>();
         _rb.velocity        = Vector3.zero;
         _rb.angularVelocity = Vector3.zero;
         _rb.useGravity      = false;
         if (_resolvedFish.Count == 0)
         {
             _joint.GetComponent <HingeJoint>().connectedBody = _rb;
         }
         else
         {
             //_resolvedFish[_resolvedFish.Count - 1].Joints[0]
         }
         _resolvedFish.Add(_fish);
     }
 }
Exemplo n.º 17
0
    /*
     * void Update()
     * {
     *  if (Input.GetKey("up")) {
     *      testEnable("Tuna", rarity);
     *  }
     * } */



    public void testEnable(fish m_fish)
    {
        ESystem.GetComponent <tutorialScript>().firstFish = true;

        FishCanvas.SetActive(true);
        PlayerUI.SetActive(false);

        FishText.text = m_fish.fishName;

        FishSprite.GetComponent <Image>().sprite = m_fish.fishSprite;

        //Time.timeScale = 0f;

        switch (m_fish.fishRarity)
        {
        case "Common":
            FishText.color = new Color(1f, 1f, 1f, 1f);
            break;

        case "Uncommon":
            FishText.color = new Color(0f, 0f, 1f, 1f);
            break;

        case "Rare":
            FishText.color = new Color(0f, 0.75f, 0f, 1f);
            break;

        case "Endangered":
            FishText.color = new Color(0.5f, 0f, 1f, 1f);
            break;

        case "Undiscovered":
            FishText.color = new Color(1f, 0.92f, 0.016f, 1f);
            break;

        default:
            FishText.color = new Color(0f, 0f, 0f, 1f);
            break;
        }
    }
Exemplo n.º 18
0
    private void setLevel(int levelNumber)
    {
        Level currentLevel = LevelsDescription.getLevelDescription(levelNumber);

        Debug.Log("LevelManager: " + "setLevel,  levelNumber = " + levelNumber);

        //apply level values to scene
        //fish number
        int  fishNum    = currentLevel.getFishTargetNumber();
        fish fishScript = GameObject.FindGameObjectWithTag("fish").GetComponent <fish>();

        fishScript.setFishNumber(fishNum);

        Debug.Log("LevelManager: " + "setLevel,  fishNum = " + fishNum);

        //level name
        string levelName = "" + currentLevel.getLevelName();

        GameObject.FindGameObjectWithTag("LevelName").GetComponentInChildren <TMP_Text>().SetText(levelName);


        Debug.Log("LevelManager: " + "levelName: " + levelName);
    }
Exemplo n.º 19
0
        static void Main(string[] args)
        {
            Fish fish = new fish();

            fish.name  = "Сом";
            fish.price = 45;
            fish.age   = 30;
            fish.place = "Озеро";

            fish.GetfishInfo();

            Fish1 fish1 = new Fish1();

            fish1.type  = "Осетровые";
            fish1.name  = "Осетр";
            fish1.place = "Реки";
            fish1.price = 100;
            fish1.mass  = 7;


            fish1.GetFish1Info();

            Console.ReadLine();
        }
Exemplo n.º 20
0
 public void CollectFish(fish pFish)
 {
     SpawnedFish.Remove(pFish);
 }
Exemplo n.º 21
0
    //
    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);
        }
    }
Exemplo n.º 22
0
 public PiledUpFishState(fish pFish) : base(pFish)
 {
 }
Exemplo n.º 23
0
 public SwimFishState(fish pFish, float pSpeed) : base(pFish)
 {
     _speed          = pSpeed;
     _outlineCounter = new counter(0);
 }
Exemplo n.º 24
0
    public int checkBiomeForSegments(fish[] arrayToCheck)
    {
        int tempNumOfSegs = 0;

        bool commonSegment       = true;
        bool uncommonSegment     = true;
        bool rareSegment         = true;
        bool endangeredSegment   = true;
        bool undiscoveredSegment = true;

        for (int x = 0; x < 21; x++)
        {
            fish tempObject = arrayToCheck[x];

            if (arrayToCheck[x].FishIsOwned == false)
            {
                if (x >= 0 && x < 10)
                {
                    commonSegment = false;
                }
                if (x >= 10 && x < 15)
                {
                    uncommonSegment = false;
                }
                if (x >= 15 && x < 18)
                {
                    rareSegment = false;
                }
                if (x >= 18 && x < 20)
                {
                    endangeredSegment = false;
                }
                if (x == 20)
                {
                    undiscoveredSegment = false;
                }
            }
            if (commonSegment)
            {
                tempNumOfSegs++;
            }
            if (uncommonSegment)
            {
                tempNumOfSegs++;
            }
            if (rareSegment)
            {
                tempNumOfSegs++;
            }
            if (endangeredSegment)
            {
                tempNumOfSegs++;
            }
            if (undiscoveredSegment)
            {
                tempNumOfSegs++;
            }
        }

        return(tempNumOfSegs);
    }
Exemplo n.º 25
0
    void Start()
    {
        RewardFish = null;


        TextAsset fishfile = Resources.Load <TextAsset>("FishIndex");

        if (fishfile)
        {
            string[] data = fishfile.text.Split(new char[] { '\n' });
            //Debug.Log("data len"+data.Length);

            for (int i = 1; i < data.Length - 1; i++)
            {
                string[] row = data[i].Split(new char[] { ',' });
                // Debug.Log(row[0]);
                //Debug.Log(i+" "+row[1]);
                name.Add(row[0]);
                biome.Add(row[1]);
                rarity.Add(row[2]);
                image.Add(row[3]);
                isCaught.Add(row[4]);
            }
        }
        else
        {
            Debug.Log("Can't read FishIndex file");
        }


        for (int i = 0; i < 21; i++)
        {
            NormalFish[i]                   = new fish();
            NormalFish[i].fishName          = name[i];
            NormalFish[i].fishBiome         = biome[i];
            NormalFish[i].fishRarity        = rarity[i];
            NormalFish[i].fishSpriteString  = image[i];
            NormalFish[i].FishIsOwnedString = isCaught[i];
            NormalFish[i].fishSprite        = Resources.Load <Sprite>("Fish_Images/Normal/" + NormalFish[i].fishSpriteString);
            NormalFish[i].FishIsOwned       = false;

            TundraFish[i]                   = new fish();
            TundraFish[i].fishName          = name[i + 21];
            TundraFish[i].fishBiome         = biome[i + 21];
            TundraFish[i].fishRarity        = rarity[i + 21];
            TundraFish[i].fishSpriteString  = image[i + 21];
            TundraFish[i].FishIsOwnedString = isCaught[i + 21];
            TundraFish[i].fishSprite        = Resources.Load <Sprite>("Fish_Images/Tundra/" + TundraFish[i].fishSpriteString);
            TundraFish[i].FishIsOwned       = false;

            MountainousFish[i]                   = new fish();
            MountainousFish[i].fishName          = name[i + 42];
            MountainousFish[i].fishBiome         = biome[i + 42];
            MountainousFish[i].fishRarity        = rarity[i + 42];
            MountainousFish[i].fishSpriteString  = image[i + 42];
            MountainousFish[i].FishIsOwnedString = isCaught[i + 42];
            MountainousFish[i].fishSprite        = Resources.Load <Sprite>("Fish_Images/Mountainous/" + MountainousFish[i].fishSpriteString);
            MountainousFish[i].FishIsOwned       = false;

            SwampFish[i]                   = new fish();
            SwampFish[i].fishName          = name[i + 63];
            SwampFish[i].fishBiome         = biome[i + 63];
            SwampFish[i].fishRarity        = rarity[i + 63];
            SwampFish[i].fishSpriteString  = image[i + 63];
            SwampFish[i].FishIsOwnedString = isCaught[i + 63];
            SwampFish[i].fishSprite        = Resources.Load <Sprite>("Fish_Images/Swamp/" + SwampFish[i].fishSpriteString);
            SwampFish[i].FishIsOwned       = false;

            ShallowFish[i]                   = new fish();
            ShallowFish[i].fishName          = name[i + 84];
            ShallowFish[i].fishBiome         = biome[i + 84];
            ShallowFish[i].fishRarity        = rarity[i + 84];
            ShallowFish[i].fishSpriteString  = image[i + 84];
            ShallowFish[i].FishIsOwnedString = isCaught[i + 84];
            ShallowFish[i].fishSprite        = Resources.Load <Sprite>("Fish_Images/Shallow/" + ShallowFish[i].fishSpriteString);
            ShallowFish[i].FishIsOwned       = false;

            TwilightFish[i]                   = new fish();
            TwilightFish[i].fishName          = name[i + 105];
            TwilightFish[i].fishBiome         = biome[i + 105];
            TwilightFish[i].fishRarity        = rarity[i + 105];
            TwilightFish[i].fishSpriteString  = image[i + 105];
            TwilightFish[i].FishIsOwnedString = isCaught[i + 105];
            TwilightFish[i].fishSprite        = Resources.Load <Sprite>("Fish_Images/Twilight/" + TwilightFish[i].fishSpriteString);
            TwilightFish[i].FishIsOwned       = false;

            SunsetFish[i]                   = new fish();
            SunsetFish[i].fishName          = name[i + 126];
            SunsetFish[i].fishBiome         = biome[i + 126];
            SunsetFish[i].fishRarity        = rarity[i + 126];
            SunsetFish[i].fishSpriteString  = image[i + 126];
            SunsetFish[i].FishIsOwnedString = isCaught[i + 126];
            SunsetFish[i].fishSprite        = Resources.Load <Sprite>("Fish_Images/Sunrise/" + SunsetFish[i].fishSpriteString);
            SunsetFish[i].FishIsOwned       = false;
        }
    }
Exemplo n.º 26
0
 public NoneFishState(fish pFish) : base(pFish)
 {
 }
 public FollowHookFishState(fish pFish) : base(pFish)
 {
 }