Untitled
unknown
plain_text
2 years ago
1.6 kB
11
Indexable
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 = 1;
public int preSet = 0;
void Start()
{
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 (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 puyoIndex = Random.Range(0, puyo.Length); Instantiate(puyo[puyoIndex], new Vector3(-12.5f, 5.5f, 0), puyo[puyoIndex].transform.rotation); }
{int puyo2Index = Random.Range(0, puyo2.Length); Instantiate(puyo2[puyo2Index], new Vector3(-12.5f, 4.5f, 0), puyo2[puyo2Index].transform.rotation); }
}
void Update()
{
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);
}
}Editor is loading...
Leave a Comment