NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{
public Transform r1;
public Transform r2;
public Transform r3;
public Transform r4;
public Transform r5;
public Transform r6;
public Transform r7;
public Transform r8;
public Transform r9;


public GameObject[] blue = new GameObject[27];
public int[] colorCube = new int[27];
public int colorCubeS =3;

bool isColorCh=true;

void Start()
{

blue[0] = GameObject.Find("blue1");
blue[1] = GameObject.Find("blue2");
blue[2] = GameObject.Find("blue3");
blue[3] = GameObject.Find("blue4");
blue[4] = GameObject.Find("blue5");
blue[5] = GameObject.Find("blue6");
blue[6] = GameObject.Find("blue7");
blue[7] = GameObject.Find("blue8");
blue[8] = GameObject.Find("blue9");

blue[9] = GameObject.Find("bluep1");
blue[10] = GameObject.Find("bluep2");
blue[11] = GameObject.Find("bluep3");
blue[12] = GameObject.Find("bluep4");
blue[13] = GameObject.Find("bluep5");
blue[14] = GameObject.Find("bluep6");
blue[15] = GameObject.Find("bluep7");
blue[16] = GameObject.Find("bluep8");
blue[17] = GameObject.Find("bluep9");

blue[18] = GameObject.Find("bluen1");
blue[19] = GameObject.Find("bluen2");
blue[20] = GameObject.Find("bluen3");
blue[21] = GameObject.Find("bluen4");
blue[22] = GameObject.Find("bluen5");
blue[23] = GameObject.Find("bluen6");
blue[24] = GameObject.Find("bluen7");
blue[25] = GameObject.Find("bluen8");
blue[26] = GameObject.Find("bluen9");



}
private void OnTriggerEnter(Collider other){
if(other.gameObject.name=="r1moveBlock"){
//Debug.Log("Çarptım");
r1.position = new Vector3(r1.position.x+486.0f,r1.position.y,r1.position.z);
}
if(other.gameObject.name=="r2moveBlock"){
r2.position = new Vector3(r2.position.x+486.0f,r2.position.y,r2.position.z);
}
if(other.gameObject.name=="r3moveBlock"){
r3.position = new Vector3(r3.position.x+486.0f,r3.position.y,r3.position.z);
}
if(other.gameObject.name=="r4moveBlock"){
r4.position = new Vector3(r4.position.x+486.0f,r4.position.y,r4.position.z);
}
if(other.gameObject.name=="r5moveBlock"){
r5.position = new Vector3(r5.position.x+486.0f,r5.position.y,r5.position.z);
}
if(other.gameObject.name=="r6moveBlock"){
r6.position = new Vector3(r6.position.x+486.0f,r6.position.y,r6.position.z);
}
if(other.gameObject.name=="r7moveBlock"){
r7.position = new Vector3(r7.position.x+486.0f,r7.position.y,r7.position.z);
}
if(other.gameObject.name=="r8moveBlock"){
r8.position = new Vector3(r8.position.x+486.0f,r8.position.y,r8.position.z);
}
if(other.gameObject.name=="r9moveBlock"){
r9.position = new Vector3(r9.position.x+486.0f,r9.position.y,r9.position.z);
}

}

void OnCollisionEnter(Collision other){
if(other.gameObject.tag=="colorChange" && isColorCh==true){
Debug.Log("Çarptım");
int colorS=0;

for(int i=0; i<9;i++){

int[] color = {0,0,0};

while(color[0] == color[1] || color[1] == color[2] || color[2] == color[0]){
color[0] = Random.Range(0, 7);
color[1] = Random.Range(0, 7);
color[2] = Random.Range(0, 7);
}
if(i==0){
var rIlk= Random.Range(0,3);
var cIlk= color[rIlk];

if(cIlk==0){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.red);
}
if(cIlk==1){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.blue);
}
if(cIlk==2){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.yellow);
}
if(cIlk==3){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.green);
}
if(cIlk==4){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.gray);
}
if(cIlk==5){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.black);
}
if(cIlk==6){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.white);
}

}

for(int x=0; x<3; x++){
var ind = color[x];
if(colorS==27){colorS=0;}
colorCube[colorS]=ind;
colorS++;
//Debug.Log(randomInt);

if(x==0){
if(ind==0){
var roadRend = blue[i].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.red);
}
if(ind==1){
var roadRend = blue[i].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.blue);
}
if(ind==2){
var roadRend = blue[i].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.yellow);
}
if(ind==3){
var roadRend = blue[i].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.green);
}
if(ind==4){
var roadRend = blue[i].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.gray);
}
if(ind==5){
var roadRend = blue[i].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.black);
}
if(ind==6){
var roadRend = blue[i].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.white);
}
}
if(x==1){
if(ind==0){
var roadRend = blue[i+9].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.red);
}
if(ind==1){
var roadRend = blue[i+9].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.blue);
}
if(ind==2){
var roadRend = blue[i+9].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.yellow);
}
if(ind==3){
var roadRend = blue[i+9].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.green);
}
if(ind==4){
var roadRend = blue[i+9].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.gray);
}
if(ind==5){
var roadRend = blue[i+9].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.black);
}
if(ind==6){
var roadRend = blue[i+9].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.white);
}

}
if(x==2){
if(ind==0){
var roadRend = blue[i+18].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.red);
}
if(ind==1){
var roadRend = blue[i+18].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.blue);
}
if(ind==2){
var roadRend = blue[i+18].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.yellow);
}
if(ind==3){
var roadRend = blue[i+18].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.green);
}
if(ind==4){
var roadRend = blue[i+18].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.gray);
}
if(ind==5){
var roadRend = blue[i+18].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.black);
}
if(ind==6){
var roadRend = blue[i+18].GetComponent<Renderer>();
roadRend.material.SetColor("_Color", Color.white);
}

}

}
isColorCh=false;
StartCoroutine(ColorLock());
}

}

if(other.gameObject.tag=="colorChangeCube"){
var colorSelectStart = colorCubeS;
var colorSelect = Random.Range(colorCubeS,colorCubeS+3); //3 4 5
colorSelectStart += colorSelect;
colorCubeS+=3;
if(colorCubeS==27){
colorCubeS=3;
}

if(colorCube[colorSelect]==0){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.red);
}
if(colorCube[colorSelect]==1){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.blue);
}
if(colorCube[colorSelect]==2){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.yellow);
}
if(colorCube[colorSelect]==3){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.green);
}
if(colorCube[colorSelect]==4){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.gray);
}
if(colorCube[colorSelect]==5){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.black);
}
if(colorCube[colorSelect]==6){
var cubeCh = gameObject.GetComponent<Renderer>();
cubeCh.material.SetColor("_Color", Color.white);
}


}
}

IEnumerator ColorLock()
{
yield return new WaitForSeconds( 1.0f ); // 1.5 saniye bekle
isColorCh=true;
}
}
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.