コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     groundSpawner = GameObject.FindObjectOfType <GroundSpawner>();
     player        = GameObject.FindGameObjectWithTag("Player");
     fog           = transform.GetChild(16).GetComponent <ParticleSystem>();
     playerStatus  = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>();
     playerStatus.counterEggSpawn++;
     SpawnTrees();
     SpawnFruits();
     //SpawnObstacle();
 }
コード例 #2
0
    //public CinemachineVirtualCamera vcam;
    // CinemachineComposer com;
    // Start is called before the first frame update
    void Start()
    {
        startTime     = Time.time;
        originalSpeed = moveSpeed;
        rb            = GetComponent <Rigidbody>();
        col           = GetComponent <SphereCollider>();
        animator      = transform.GetChild(0).gameObject.GetComponent <Animator>(); //GetComponent<Animator>();
        chSt          = GetComponent <ChickenStatus>();

        playerStatus = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>();
        StartCoroutine(ExecuteAfterTime(4f));
        //com = vcam.GetCinemachineComponent<CinemachineComposer>();
        // com.m_HorizontalDamping = 7f;
    }
コード例 #3
0
ファイル: GroundLeft.cs プロジェクト: Yiangos01/Games_ucy
    // Start is called before the first frame update
    void Start()
    {
        groundSpawner = GameObject.FindObjectOfType <GroundSpawner>();
        player        = GameObject.FindGameObjectWithTag("Player");
        fog           = transform.GetChild(16).GetComponent <ParticleSystem>();
        playerStatus  = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>();
        playerStatus.counterEggSpawn++;
        //SpawnObstacle();
        SpawnTrees();
        SpawnFruits();

        //int frequencyLake = Random.Range(0, 20);
        // if (frequencyLake < 1)
        //  groundSpawner.SpawnLake();
    }
コード例 #4
0
    // Start is called before the first frame update
    void Start()
    {
        chSt             = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>();
        trgtPattern      = chSt.targetPatternStrength;
        apple.color      = initialColor;
        banana.color     = initialColor;
        carrot.color     = initialColor;
        cherry.color     = initialColor;
        grape.color      = initialColor;
        pumpkin.color    = initialColor;
        watermelon.color = initialColor;


        temp     = new Image[chSt.patternSize];
        statusUI = GameObject.FindGameObjectWithTag("StatusUI");
        pos      = statusUI.transform.GetChild(1).position;
    }
コード例 #5
0
ファイル: GoldenEgg.cs プロジェクト: Yiangos01/Games_ucy
 // Start is called before the first frame update
 void Start()
 {
     chs       = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>();
     goldenEgg = chs.goldenEgg;
 }
コード例 #6
0
ファイル: LifeCounter.cs プロジェクト: Yiangos01/Games_ucy
 // Start is called before the first frame update
 void Start()
 {
     chs   = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>();
     heart = chs.heart;
 }
コード例 #7
0
 public Chicken(int inNumber, ChickenStatus status)
 {
     this.Number = inNumber;
     this.Status = status;
 }
コード例 #8
0
    // only 1 egg in the track


    // Start is called before the first frame update
    void Start()
    {
        // Debug.Log("Start first line");
        //Always spawn decor
        groundSpawner = GameObject.FindObjectOfType <GroundSpawner>();
        player        = GameObject.FindGameObjectWithTag("Player");
        playerStatus  = GameObject.FindGameObjectWithTag("Player").GetComponent <ChickenStatus>();
        fog           = transform.GetChild(11).GetComponent <ParticleSystem>();
        barn          = groundSpawner.isBarn;
        eggCounter    = GameObject.FindGameObjectWithTag("GoldenEggCounter");
        eggs          = eggCounter.GetComponent <GoldenEgg>().goldenEgg;

        SpawnTrees();
        playerStatus.counterEggSpawn++;
        // eggTypeId = Random.Range(0, 3);
        int frequencyTypeEgg = Random.Range(0, 3);

        SpawnGoldenEggs();
        if (!barn)  //If not spawn barn
        {
            if (!groundSpawner.isStart)
            {                                           //At the start of the game don't spawn obstacles
             //Choose if spawn a moving obstacle-less chance
                int moving = Random.Range(0, 8 - eggs); //More chance to generate moving obstacles when got more eggs
                if (hardMode)
                {
                    // Avoid creating moving and stationary obstacle
                    if (moving < 2)
                    {
                        SpawnObstacle(true);
                    }
                    else
                    {
                        SpawnObstacle(false);
                        SpawnObstacle(false);
                        if (eggs >= 2 && eggs < 4) //If collected between 2 and 4 eggs, spawn 3rd obstacle
                        {
                            SpawnObstacle(false);
                        }
                        else if (eggs >= 4)
                        { //If collected 4 eggs, spawn 3rd and 4th obstacle
                            SpawnObstacle(false);
                            SpawnObstacle(false);
                        }
                    }
                }
                else
                {
                    if (moving < 2)
                    {
                        SpawnObstacle(true);
                    }
                    else
                    {
                        SpawnObstacle(false);
                        SpawnObstacle(false);
                        if (eggs >= 2 && eggs < 4)
                        { //If collected between 2 and 4 eggs, spawn 3rd obstacle
                            SpawnObstacle(false);
                        }
                        else if (eggs >= 4)
                        { //If collected 4 eggs, spawn 3rd and 4th obstacle
                            SpawnObstacle(false);
                            SpawnObstacle(false);
                        }
                    }
                }
            }

            if (groundSpawner.isStart)
            {
                transform.GetChild(11).gameObject.SetActive(false);
            }
            // Spawn only one type of object on a single tile

            //Spawnpotion less frequent chance


            int frequencyPotion = Random.Range(0, 20);


            if (frequencyPotion < 1)
            {
                SpawnPotion();
            }
            SpawnFruits();
        }
    }
コード例 #9
0
ファイル: PettingController.cs プロジェクト: bSolla/wingin-it
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
//                               M E T H O D S
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    void Start()
    {
        stat = GetComponent <ChickenStatus>();
        heartParticles.Stop();
    }