Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
1.4 kB
5
Indexable
Never
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SpawnPuyo : MonoBehaviour
{
  public GameObject[] puyo;
  public GameObject[] puyo2;
  public float startDelay = 10;
  public float spawnInterval = 10;
  public float puyoType = 2;
  public float puyoClone = 0;
  public float puyoClone2 = 0;
  public int set = 0;
  public int preSet = 1;
  void Start()
  {
    if (puyoType == 1) ;
    if (set == preSet + 1)
    { int puyoIndex = Random.Range(0, puyo.Length); Instantiate(puyo[puyoIndex], new Vector3(-12.5f, 5.5f, 0), puyo[puyoIndex].transform.rotation); }
    puyoClone = 1;

    if (puyoType == 2)
      if (set == preSet + 1)
      { int puyo2Index = Random.Range(0, puyo2.Length); Instantiate(puyo2[puyo2Index], new Vector3(-12.5f, 4.5f, 0), puyo2[puyo2Index].transform.rotation); }
    puyoClone = 2;
    if (Input.GetKeyDown(KeyCode.Z))
      transform.Translate(1, 1, 0);


    if (transform.position.y > -5.5)
      transform.Translate(0, -0.01f, 0);
    if (transform.position.y = -5.5)
    {
      int set = (set + 1);
      int preSet = (preSet + 1);
    }

    if (Input.GetKey(KeyCode.LeftArrow))
      if (transform.position.x > -14.5)
        transform.Translate(-1, 0, 0);

    if (Input.GetKey(KeyCode.RightArrow))
      if (transform.position.x < -9.5)
        transform.Translate(1, 0, 0);

  }

}
Leave a Comment