Click here to Skip to main content
15,889,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Assets/Scripts/Game.cs(13,30): error CS1061: Type `UnityEngine.GameObject' does not contain a definition for `ActiveSelf' and no extension method `ActiveSelf' of type `UnityEngine.GameObject' could be found. Are you missing an assembly reference?



using UnityEngine.UI;
using UnityEngine;


public class Game : MonoBehaviour {

	public Text scoreText;
	public GameObject ShopPan;
	private int score;

	public void ShopPan_ShowAndHide()
	{
		ShopPan.SetActive(!ShopPan.ActiveSelf);
	}

	public void OnClick()
	{
		score++;
		scoreText.text = score + "$"; 
	}
}


What I have tried:

Help me pls.I do notkniw what to do
Posted
Updated 27-Oct-19 1:43am

1 solution

You are probably using an older version of Unity, see: if gameobject is active? - Unity Answers[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900