本文整理汇总了C#中BoardManager类的典型用法代码示例。如果您正苦于以下问题:C# BoardManager类的具体用法?C# BoardManager怎么用?C# BoardManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BoardManager类属于命名空间,在下文中一共展示了BoardManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Awake
//Awake is always called before any Start functions
public void Awake()
{
//Check if instance already exists
if (instance == null)
//if not, set instance to this
instance = this;
//If instance already exists and it's not this:
else if (instance != this)
//Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
Destroy(gameObject);
//Sets this to not be destroyed when reloading scene
DontDestroyOnLoad(gameObject);
//Assign enemies to a new List of Enemy objects.
enemies = new List<Enemy>();
//Get a component reference to the attached BoardManager script
boardScript = GetComponent<BoardManager>();
//Call the InitGame function to initialize the first level
if (!firtTimeLoad) {
InitGame();
}
//Call the canva menuPrincipale for the first time loading the scene
if (firtTimeLoad) {
menuprincipal = (GameObject)Instantiate(Resources.Load("Prefabs/CanvasMenuPrincipal"));
menuprincipal.SetActive (true);
firtTimeLoad = false;
}
}
开发者ID:sebinou123,项目名称:tp4-multi,代码行数:36,代码来源:GameManager.cs
示例2: OnEnable
void OnEnable()
{
Debug.Log("Enable");
boardScript = GetComponent<BoardManager>();
enemiesMoving = false;
InitGame();
}
开发者ID:XSAM,项目名称:2D-Roguelike,代码行数:7,代码来源:GameManager.cs
示例3: Start
// Use this for initialization
void Start()
{
bM_script = GameObject.Find("BoardManager").GetComponent<BoardManager>();
change = false;
Debug.Log("AddArrow");
bM_script.ArrowList.Add(gameObject);
}
开发者ID:vietanh1441,项目名称:AnimalFarm,代码行数:8,代码来源:Arrow.cs
示例4: init
public void init(int tileType, BoardManager board) {
this.board = board;
turnCount = 0;
tileObj = GameObject.CreatePrimitive(PrimitiveType.Quad);
tileMod = tileObj.AddComponent<TileModel>();
tileMod.init(this, type);
}
开发者ID:severhale,项目名称:Marble-Mayhem,代码行数:7,代码来源:Tile.cs
示例5: Start
// Use this for initialization
void Start()
{
bM = GameObject.Find("BoardManager");
bM_script = bM.GetComponent<BoardManager>();
bM_script.CountDownList.Add(gameObject);
bM_script.CleanUpList.Add(gameObject);
}
开发者ID:vietanh1441,项目名称:AnimalFarm,代码行数:8,代码来源:CoinMaker.cs
示例6: Awake
//Awake is always called before any Start functions
void Awake()
{
//Check if instance already exists
if (instance == null)
//if not, set instance to this
instance = this;
//If instance already exists and it's not this:
else if (instance != this)
//Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
Destroy(gameObject);
//Sets this to not be destroyed when reloading scene
DontDestroyOnLoad(gameObject);
//Assign enemies to a new List of Enemy objects.
//enemies = new List<Enemy>();
//transform.name.Replace("(clone)", "").Trim();
//Get a component reference to the attached BoardManager script
boardScript = GetComponent<BoardManager>();
//Call the InitGame function to initialize the first level
InitGame();
////////////my test for block
//CreateLevelFromJavatoXml block = new CreateLevelFromJavatoXml();
}
开发者ID:DeFenox,项目名称:DinoLogicNew,代码行数:31,代码来源:GameManager.cs
示例7: Awake
private int level = 1; //Current level number, expressed in game as "Day 1".
#endregion Fields
#region Methods
//Awake is always called before any Start functions
void Awake()
{
//Sets this to not be destroyed when reloading scene
DontDestroyOnLoad (gameObject);
//Check if instance already exists
if (instance == null) {
//if not, set instance to this
instance = gameObject.GetComponent<GameManager>();
}
//If instance already exists and it's not this:
else if (instance != gameObject.GetComponent<GameManager>())
{
//Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
Destroy (gameObject);
}
//Get a component reference to the attached BoardManager script
boardScript = GetComponent<BoardManager> ();
//Call the InitGame function to initialize the first level
if (shouldCreatePlayers)
{
InitGame();
}
}
开发者ID:stlgamedev,项目名称:gateway2dwest,代码行数:35,代码来源:GameManager.cs
示例8: Awake
void Awake()
{
sound= GetComponent<AudioSource>();
bSoundOn= GameObject.Find ("sound_on").GetComponent<Button>();
bSoundOff= GameObject.Find ("sound_off").GetComponent<Button>();
if (PlayerPrefs.GetInt ("mute", 0) == 0) {
bSoundOff.gameObject.SetActive (false);
} else {
bSoundOn.gameObject.SetActive (false);
}
mute = PlayerPrefs.GetInt ("mute")==1;
if (mute)
sound.mute = true;
blackTransparent = new Color32 (40,40,40,0);
white= new Color32 (255,255,255,255);
boardScript=GetComponent<BoardManager>();
boardScript.createBoard (8);
boardScript.InstatiatePolygons (15,1,4);
//StartCoroutine("initialize");
title.position = new Vector3 (title.position.x,title.position.y-(Screen.height/4)+50);
}
开发者ID:kasunbdn,项目名称:Floating-Polygons,代码行数:25,代码来源:MainMenu.cs
示例9: Awake
// Use this for initialization
void Awake()
{
if (instance == null) instance = this;
else if (instance != null) Destroy(gameObject);
DontDestroyOnLoad (gameObject);
boardScript = GetComponent<BoardManager> ();
InitGame ();
}
开发者ID:urgamedev,项目名称:UnityBomberman2D,代码行数:9,代码来源:GameManager.cs
示例10: Start
void Start()
{
boardManagerScript = FindObjectOfType<BoardManager>();
pickUp = (GameObject)Resources.Load("Prefabs/Pick Ups/Temporary"); // Change from temp Prefab in future.
pickUpList = new List<PickUpItem>();
totalPickUps = 0;
createPickUps();
}
开发者ID:romanlarionov,项目名称:Sabotage,代码行数:9,代码来源:PickUpManager.cs
示例11: Awake
void Awake()
{
currentState = Config.STARTED;
if (instance == null)
instance = this;
else if (instance != this)
Destroy (gameObject);
boardScript = GetComponent<BoardManager> ();
}
开发者ID:mwillson,项目名称:LD33,代码行数:10,代码来源:GameManager.cs
示例12: Awake
void Awake () {
if (instance == null) {
instance = this;
} else if (instance != this) {
Destroy(gameObject);
}
DontDestroyOnLoad(gameObject);
boardManager = GetComponent<BoardManager>();
InitGame();
}
开发者ID:blakewedwards,项目名称:pushspace,代码行数:11,代码来源:GameManager.cs
示例13: Start
void Start () {
gameManager = GameObject.FindGameObjectWithTag ("GameManager") as GameObject;
if (gameManager == null) {
Debug.LogError("Tag GameManager object with the GameManager tag");
}
boardManager = gameManager.GetComponent<BoardManager> ();
uiManager = gameManager.GetComponent<UIManager> ();
}
开发者ID:tiagosomda,项目名称:FloodIt,代码行数:11,代码来源:MazeItem.cs
示例14: Awake
void Awake()
{
// Enforce singleton-ness
if (instance == null)
instance = this;
else if (instance != this)
Destroy (gameObject);
boardManager = GetComponent<BoardManager> ();
boardManager.SetupScene ();
}
开发者ID:dyerw,项目名称:project-tiki-torch,代码行数:11,代码来源:GameManager.cs
示例15: initGame
void initGame() {
boardScript = GetComponent<BoardManager>();
doingSetup = true;
//levelImage = GameObject.Find ("levelImage");
//levelText = GameObject.Find ("levelText").GetComponent<Text>();
//levelText.text = "Day " + level;
//levelImage.SetActive (true);
//Invoke("hideLevelImage", levelStartDelay);
boardScript.setupScene(level);
}
开发者ID:lalibelamonk,项目名称:herman,代码行数:11,代码来源:GameManager.cs
示例16: Awake
// Use this for initialization
void Awake()
{
if (instance == null)
instance = this;
else if (instance != this)
Destroy(gameObject); //singletoooooon
DontDestroyOnLoad(gameObject);
enemies = new List<Enemy>();
boardScript = GetComponent<BoardManager>();
InitLevel();
}
开发者ID:urgamedev,项目名称:roguelike,代码行数:12,代码来源:GameManager.cs
示例17: Awake
void Awake(){
if (instance == null){
instance = this;
}else{
Destroy(gameObject);
}
DontDestroyOnLoad(gameObject);
enemies = new List<Enemy>();
boardScript = GetComponent<BoardManager>();
InitGame();
}
开发者ID:clcreations,项目名称:2DRogueLike,代码行数:11,代码来源:GameManager.cs
示例18: Awake
void Awake()
{
if(instance==null) instance = this;
else if(instance!=this) Destroy(gameObject);
DontDestroyOnLoad(gameObject);//dont destroy on load new scene!
enemies = new List<Enemy>();
boardScript = GetComponent<BoardManager>();
InitGame();
}
开发者ID:icaromagalhaes,项目名称:unity-2d-roguelike-game,代码行数:12,代码来源:GameManager.cs
示例19: Awake
void Awake()
{
if (instance == null) // if no previous manager
{
instance = this;
} else if (instance != this) // if manager already exists dont make another
{
Destroy(gameObject);
}
DontDestroyOnLoad(gameObject);// makes this not die when a new scene is loaded
boardScript = GetComponent<BoardManager>();
InitGame();
}
开发者ID:Gowtham100,项目名称:GameJamVancouver,代码行数:13,代码来源:GameManagerScript.cs
示例20: gameOver
public void gameOver()
{
level = 1;
GameObject[] objects = GameObject.FindObjectsOfType<GameObject> ();
foreach (GameObject o in objects) {
if(!(o.name.Contains("GameManager") ||o.name.Contains ("SoundManager") || o.name.Contains("EmptyObject")||o.name.Contains("Event")||o.name.Contains("Light")))
Destroy(o);
}
boardScript = GetComponent<BoardManager> ();
turnScript = GetComponent<TurnManager> ();
gridScript = GetComponent<Grid> ();
}
开发者ID:jhasson84,项目名称:SBGB,代码行数:13,代码来源:GameManager.cs
注:本文中的BoardManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论