当前位置: 首页>>代码示例>>C#>>正文


C# GameManager类代码示例

本文整理汇总了C#中GameManager的典型用法代码示例。如果您正苦于以下问题:C# GameManager类的具体用法?C# GameManager怎么用?C# GameManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GameManager类属于命名空间,在下文中一共展示了GameManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

	void Start () {
        root = GameObject.Find("UI Root");
        gm = GameObject.Find("GameManager").GetComponent<GameManager>();
        nameLabel = root.transform.Find("Avg_Panel/Label_Name").GetComponent<UILabel>();
        dialogLabel = root.transform.Find("Avg_Panel/Label_Dialog").GetComponent<UILabel>();
        nameLabel.fontSize = 22;
	}
开发者ID:lshy1993,项目名称:LianaiYuTuili,代码行数:7,代码来源:TextManager.cs

示例2: Start

 void Start()
 {
     tParent = transform.parent;
     networkView = tParent.GetComponent <NetworkView>();
     gameObject.SetActive(networkView.isMine);
     gm = GameManager.Instance;
 }
开发者ID:bruteostrich,项目名称:GnomeArena,代码行数:7,代码来源:CamHandler.cs

示例3: Init

	private void Init(){
		this.gameManager = GameObject.Find ("GameManager").GetComponent<GameManager> ();
		this.player = GameObject.Find ("Player").GetComponent<PlayerScript> ();
		this.enemy = GameObject.Find ("Enemy").GetComponent<EnemyScript> ();
		this.mPlayerShieldHP = Constants.ShieldPoint;
		this.mEnemyShieldHP = Constants.ShieldPoint;
	}
开发者ID:shoK0613,项目名称:snowProjForUnity,代码行数:7,代码来源:BattleCalc.cs

示例4: Start

 // Use this for initialization
 void Start()
 {
     PlayerCam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>(); // Find the Camera's GameObject from its tag
     _GameManager = gameObject.GetComponent<GameManager>();
     _player1AI = _GameManager.player1AI;
     _player2AI = _GameManager.player2AI;
 }
开发者ID:w1ng,项目名称:Chess,代码行数:8,代码来源:PlayerControl.cs

示例5: Update

    // Update is called once per frame
    void Update()
    {
        if (gManager == null) {
            gManager=GameManager.Instance();
        }
        //Debug.Log (interactions.getIsGrabbed());
        if (gManager.currentLevel != GameManager.LevelStatus.planting) {
            gameObject.SetActive(false);
        }

        Debug.Log (this.name + " " + interactions.getIsGrabbed ());
        if (interactions.getIsGrabbed()&&!downTime&&!gManager.isHandGrabbing())
        {
            //Debug.Log("I have seeds");
            GameObject newObject;
            newObject= (GameObject)(Instantiate(thisIsABagOf,interactions.getCursorPosition(), Quaternion.identity));

            newObject.SendMessage("SetGrabbed", SendMessageOptions.DontRequireReceiver);
            downTime= true;
            someTime= Time.time;
        }
        if (!interactions.getIsGrabbed()&&downTime&&(Time.time-someTime)>1)

        {
            downTime= false;
        }
    }
开发者ID:tommyfriday,项目名称:SensorySteps,代码行数:28,代码来源:BagOfSeedsScript.cs

示例6: Initialize

 public void Initialize(float speed, GameObject player, GameManager manager)
 {
     SetSpeed (speed);
     this.player = player;
     this.manager = manager;
     scored = false;
 }
开发者ID:RobKopp,项目名称:JumpDuck,代码行数:7,代码来源:ItemController.cs

示例7: Start

 // Use this for initialization
 void Start()
 {
     if (GameObject.Find("GameManager"))
     {
         gameManager = GameObject.Find("GameManager").GetComponent<GameManager>();
     }
 }
开发者ID:RONALDO2806,项目名称:3DGameCoursera,代码行数:8,代码来源:TextoTiempo.cs

示例8: OnEnable

 void OnEnable()
 {
     if (gm == null)
     {
         gm = GameObject.FindGameObjectWithTag("GM").GetComponent<GameManager>();
     }
 }
开发者ID:Cristian006,项目名称:ProjectByte,代码行数:7,代码来源:GameManager.cs

示例9: CreateScorePanel

 private void CreateScorePanel(GameManager.LevelScore levelScore)
 {
     var spi = Instantiate(ScorePanelItemPrefab);
     spi.GetComponentInChildren<Text>().text = string.Format("Level {0}{3}Score: {1}{3}Faults: {4}{3}{2}",
         levelScore.LevelNumber, levelScore.Score, levelScore.Time.Minutes+"m " + levelScore.Time.Seconds + "s " + levelScore.Time.Milliseconds + "ms", Environment.NewLine, levelScore.Faults);
     spi.transform.SetParent(ScoresPanel);
 }
开发者ID:jarena3,项目名称:Ool,代码行数:7,代码来源:GameOverManager.cs

示例10: TileMapData

    // tile map
    public TileMapData(int x_size, int y_size)
    {
        this.size_x = x_size;
        this.size_y = y_size;

        map_tiles = new DTile[size_x, size_y];

        // gameManager Stuff
        go = GameObject.Find("GameManager(Clone)");
        gameManagerScript = go.GetComponent<GameManager>();

         //   Debug.Log("ITs not null");

        // Construct Data map with Tiles from XML

        // Example without XML
        for (int x = 0; x < size_x; x++)
        {
            for (int y = 0; y < size_y; y++)
            {
                map_tiles[x, y] = new DBuildTile(x, y);
            }
        }

        if (gameManagerScript.getWaypoints() != null) {
            List<Vector2> wayPointsList = gameManagerScript.getWaypoints();
            // add path to tile
        //    Debug.Log("Starting Pathing");
            int mini;
            int maxi;
            for (int i = 0; i < wayPointsList.Count - 1; i++)
            {
                Vector2 current = wayPointsList[i];
                Vector2 next = wayPointsList[i + 1];
                // vertical
                if (current.x == next.x)
                {
                    // loop from start to next mark path tile
                    int x = (int)current.x;
                    mini = Mathf.Min((int)current.y, (int)next.y);
                    maxi = Mathf.Max((int)current.y, (int)next.y);
                    for (int y = mini; y < maxi + 1; y++)
                    {
                        map_tiles[x, y] = new DWalkableTile(x, y);
                    }
                }
                // horizontal
                else {
                    int y = (int)current.y;
                    mini = Mathf.Min((int)current.x, (int)next.x);
                    maxi = Mathf.Max((int)current.x, (int)next.x);
                    // loop from start to next mark
                    for (int x = mini; x < maxi + 1; x++)
                    {
                        map_tiles[x, y] = new DWalkableTile(x, y);
                    }
                }
            }
        }
    }
开发者ID:thePandaBear,项目名称:DistroOpenProject2015,代码行数:61,代码来源:TileMapData.cs

示例11: Awake

	void Awake ()
	{
		onFire = false;
		announcerAudio = GetComponents<AudioSource> () [1];
		playerAttack = GetComponent<PlayerAttack> ();

		canvas = GameObject.Find ("HUDCanvas");
		//Debug.Log ("PlayerHealthUI_" + playerAttack.playerNum);

		inGameHealthUI = canvas.GetComponent<RectTransform> ().Find ("PlayerHealthUI_" + playerAttack.playerNum)
			.GetComponent<InGameHealthUI>();
		inGameHealthUI.playerHealth = this;
		rigid = GetComponent<Rigidbody> ();
		gm = GameObject.Find ("GameManager").GetComponent<GameManager> ();
		uim = GameObject.Find ("GameManager").GetComponent<UI_Manager> ();
		joystickNum = playerAttack.joystickNum;
		damageReduction = 1;
		allgrounds = GameObject.FindGameObjectsWithTag("Island");
		anim = GetComponent <Animation> ();
		playerAudio = GetComponent <AudioSource> ();
		playerMovement = GetComponent <PlayerMovement> ();

		//playerShooting = GetComponentInChildren <PlayerShooting> ();
		currentHealth = startingHealth;
		SetupHealthUI ();
	}
开发者ID:kkiniaes,项目名称:Fire-On-Ice,代码行数:26,代码来源:PlayerHealth.cs

示例12: Start

    // Use this for initialization
    void Start()
    {
        gm = FindObjectOfType<GameManager>();

        rigidbody = GetComponent<Rigidbody2D>();
        ResetBall();
    }
开发者ID:Maldercito,项目名称:pong,代码行数:8,代码来源:1453988742$ball.cs

示例13: Start

 // Use this for initialization
 void Start()
 {
     SilhouetteBG = gameObject.transform.GetChild(0).GetComponent<RectTransform>();
     Boat = GameObject.Find("Boat");
     mGame = GameObject.FindGameObjectWithTag("Manager").GetComponent<GameManager>();
     //SilhouetteCanvas = SilhouetteCanvasObj.GetComponent<
 }
开发者ID:Mitsukizzy,项目名称:Archipelago,代码行数:8,代码来源:Silhouette.cs

示例14: MultiplayerRaceMode

 public MultiplayerRaceMode(GameManager gameInstance, int laps, int noOfCheckpoints, RaceTrack raceTrack, Car localCar)
     : base(gameInstance, laps, noOfCheckpoints, raceTrack, localCar)
 {
     this.Mode = Mode.Multiplayer;
     players.AddRange(gameInstance.GetService<ServerClient>().Players.Values);
     AddLapTriggers();
 }
开发者ID:MintL,项目名称:datx02-rally,代码行数:7,代码来源:MultiplayerRaceMode.cs

示例15: Start

 /// <summary>
 /// Inicia o jogador
 /// </summary>
 void Start()
 {
    playerPhysics = GetComponent<PlayerPhysics>();
    animator = GetComponent<Animator>();
    manager = Camera.main.GetComponent<GameManager>();
    animator.SetLayerWeight(0, 0);
 }
开发者ID:Kokline,项目名称:ProjetoIntegradorD,代码行数:10,代码来源:PlayerController.cs


注:本文中的GameManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。