當前位置: 首頁>>代碼示例>>C#>>正文


C# BoardManager類代碼示例

本文整理匯總了C#中BoardManager的典型用法代碼示例。如果您正苦於以下問題:C# BoardManager類的具體用法?C# BoardManager怎麽用?C# BoardManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BoardManager類屬於命名空間,在下文中一共展示了BoardManager類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的BoardManager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。