Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when double click on button error occurring tell me where is the wrong on this code.. #1

Open
subbuhunter opened this issue Jan 3, 2018 · 1 comment

Comments

@subbuhunter
Copy link

This is the error occurring :-

NullReferenceException: (null)
UnityEngine.MonoBehaviour.StopCoroutine (UnityEngine.Coroutine routine) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/MonoBehaviourBindings.gen.cs:99)

This is the code :-

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

public class Test : MonoBehaviour {

public GameObject Testobject;

public GameObject Main_Menu;
public Material[] TestShaders;
public Texture[] TestTextures;
public Texture[] TestPatterns;
public Color[] TestColors;

int m;

//To Change Menus 
public void Change_Menus(int x)
{
	for (int y = 1; y < Main_Menu.transform.childCount; y++) 
	{
		Main_Menu.transform.GetChild(y).gameObject.SetActive (false);
	}
	Main_Menu.transform.GetChild (x).gameObject.SetActive (true);

	x = m;
}
//To Function Shader 
public void Function_Shader_Menus(int x)
{
	Testobject.GetComponent<Renderer> ().material = TestShaders[x];
}
//To Function Texture
public void Function_Texture_Menus(int x)
{
	Testobject.GetComponent<Renderer> ().material.mainTexture = TestTextures[x];
}
//To Function Pattern
public void Function_Pattern_Menus(int x)
{
	Testobject.GetComponent<Renderer> ().material.mainTexture = TestPatterns[x];
}
//To Function Pattern Color 
public void Function_Pattern_Color_Menus(int x)
{
	Testobject.GetComponent<Renderer> ().material.color = TestColors[x];
}

}

@aosoft
Copy link
Owner

aosoft commented Jan 6, 2018

Are you using Xamarin.Forms ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants