Home > other >  Whack-a-mole code in c #, small problems still meet you, a word, don't know how to change, (lev
Whack-a-mole code in c #, small problems still meet you, a word, don't know how to change, (lev

Time:09-17

Below the HoleController, error (error 1 failed to find the type or namespace name "Assets" (whether the lack of a using directive or assembly reference?) )
(2 error failed to find the type or namespace name "HoleController" (whether or not the lack of a using directive or assembly reference?)



Using System. The Collections;
Using System. Collections. Generic;
using UnityEngine;
Using Assets. DEvelop_scripts;



Public class Gamecontroller: MonoBehaviour
{
# region Sigleton
Public static Gamecontroller _instance.
Public Gamecontroller GetInstance
{
The get {return _instance; }
}
Void Awake ()
{
_instance=this;
}
# endregion
//the only global variable

Private GameState this_State=GameState. Play;
Public GameState GetState
{
The set {this_State=value; }
The get {return this_State; }
}

Private GameState lastState;

Private HoleController [] HoleController;

Void the Start ()
{
LastState=this_State;
SendNotice ();
}
Void the Update ()
{
If (lastState!=this_State)
SendNotice ();
}
Void SendNotice ()
{
If (this_State!=GameState. Play)
{
for(int i=0; IHoleController [I] StartSpawn ();
}
}
Public void ChangePlay ()
{
This_State=GameState. Play;
}
Public void ChangeEnd ()
{
This_State=GameState. End;
}
}

CodePudding user response:


This is the picture of the code, I hope the great god explained in detail
  • Related