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


C# GameControl类代码示例

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


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

示例1: Start

	// Use this for initialization
	void Start () {
		gc = gco.GetComponent<GameControl>();
		gp = gco.GetComponent<GamePlay>();

		pos.y = -3.5F;
		pos.z = -2;
	}
开发者ID:MizzKii,项目名称:PuruDash2D,代码行数:8,代码来源:BearAttack.cs

示例2: load

    public void load()
    {
        //Create the GameControl and a Player.
        //Checks that loads are correctly done.
        GameControl subGameControl = new GameControl();
        PlayerData subPlayerData = new PlayerData();
        subGameControl.playerData = subPlayerData;

        subPlayerData.playerStr = 8;
        subPlayerData.playerAgl = 7;
        subPlayerData.playerDex = 6;
        subPlayerData.playerInt = 5;
        subPlayerData.playerVit = 4;
        subPlayerData.currentGameLevel = 3;
        subPlayerData.abilityPoints = 2;

        subGameControl.Load();

        Assert.That(subGameControl.playerStr == 8);
        Assert.That(subGameControl.playerAgl == 7);
        Assert.That(subGameControl.playerDex == 6);
        Assert.That(subGameControl.playerInt == 5);
        Assert.That(subGameControl.playerVit == 4);
        Assert.That(subGameControl.currentGameLevel == 3);
        Assert.That(subGameControl.abilityPoints == 2);
    }
开发者ID:unit02,项目名称:SoftEng-306-Project-2,代码行数:26,代码来源:UnitTests.cs

示例3: Start

    void Start()
    {
        GameObject[] wps = GameObject.FindGameObjectsWithTag (Tags.waypoint).OrderBy (go => go.name).ToArray();
        List<Vector3> wplist = new List<Vector3> (wps.Length + 15);
        GameObject[] racks = GameObject.FindGameObjectsWithTag (Tags.rack).OrderBy (go => go.name).ToArray();
        int i = 0;
        foreach (GameObject r in racks) {
            int n = int.Parse (r.name.Last().ToString());
            Vector3 rack = r.transform.position;
            UnityEngine.AI.NavMeshHit hit;
            if (UnityEngine.AI.NavMesh.SamplePosition (rack, out hit, 0.5f, UnityEngine.AI.NavMesh.AllAreas))
                rack = hit.position;
            wplist.Add (rack);
            while (i < wps.Length && wps[i].name.Contains (n + "-")) {
                wplist.Add (wps[i].transform.position);
                i++;
            }
            wplist.Add (rack);
        }
        waypoints = wplist.ToArray();

        gameControl = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<GameControl>();

        agent.SetDestination (waypoints[currentWP]);
    }
开发者ID:MatejVitek,项目名称:Intelligent-Agents,代码行数:25,代码来源:BasicGBA.cs

示例4: StartEvent

	public void StartEvent(float x, float y, float flowY) {
		gameControl = GameObject.Find("GameControl").GetComponent("GameControl") as GameControl; 
		gameControl.eventRun = true;;
		eventObject = Instantiate(Stalactite,new Vector3(x, y + Stalactite.transform.localScale.y/2, -2F),Quaternion.Euler(0f,0f,0f)) as GameObject;
		downY = -3 + flowY;
		step = 1;
	}
开发者ID:MizzKii,项目名称:PuruDash2D,代码行数:7,代码来源:StalactiteRealTime.cs

示例5: resetStat

    public void resetStat()
    {
        //Create the GameControl, IncreaseStat and a Player.
        //Check that attributes are correctly reset.
        IncreaseStat subIS = new IncreaseStat();
        GameControl subGameControl = new GameControl();
        GameControl.control = subGameControl;
        Player subPlayer = new Player();

        subPlayer.strength = 5;
        subPlayer.dexterity = 5;
        subPlayer.vitality = 5;
        subPlayer.intelligence = 5;
        subPlayer.agility = 5;
        subIS.player = subPlayer;

        subGameControl.playerStr = 5;
        subGameControl.playerDex = 5;
        subGameControl.playerVit = 5;
        subGameControl.playerInt = 5;
        subGameControl.playerAgl = 5;

        subIS.doReset();

        Assert.That(subPlayer.strength == 1);
        Assert.That(subPlayer.dexterity == 1);
        Assert.That(subPlayer.vitality == 1);
        Assert.That(subPlayer.intelligence == 1);
        Assert.That(subPlayer.agility == 1);
        Assert.That(subGameControl.playerStr == 1);
        Assert.That(subGameControl.playerDex == 1);
        Assert.That(subGameControl.playerVit == 1);
        Assert.That(subGameControl.playerInt == 1);
        Assert.That(subGameControl.playerAgl == 1);
    }
开发者ID:unit02,项目名称:SoftEng-306-Project-2,代码行数:35,代码来源:UnitTests.cs

示例6: Start

	// Use this for initialization
	void Start () {
		lv = PlayerPrefs.GetInt("LV_Rocket");
		if(lv == 0)
			time = 8;
		else if(lv == 1)
			time = 10;
		else if(lv == 2)
			time = 14;
		else if(lv == 3)
			time = 18;
		else
			time = 24;
		//////////////////////////////////////////////////
		gp = GameObject.Find("GameControl").GetComponent<GamePlay>();
		gc = GameObject.Find("GameControl").GetComponent<GameControl>();
		gc.Rocket = true;
		gp.checkrungame = false;
		speed = gc.speedControl;
		if(GameObject.Find("CharacterControl") != null) {
			_character = GameObject.Find("CharacterControl");
			_character.transform.name = "CC";
			Debug.Log("CharacterControl");
		}else
			_character = GameObject.Find("CC");
		cc = _character.GetComponent<CharacterControl>();
		pos.x = gc.stopCharacterX+2;
		pos.y = -3.5F;
		pos.z = -2;

		posY.z = -2;
	}
开发者ID:MizzKii,项目名称:PuruDash2D,代码行数:32,代码来源:Rocket.cs

示例7: Start

	void Start () {
	

	   guiScore = GameObject.Find ("guiScore").guiText;
		game = GameControl.getInstence ();
		game.Score = 0;
	}
开发者ID:ishaklive,项目名称:CatchTheFruit,代码行数:7,代码来源:Catch.cs

示例8: ScriptRunner

 //-----------------------------------------------------------------------------
 // Constructor
 //-----------------------------------------------------------------------------
 public ScriptRunner(GameControl gameControl)
 {
     this.gameControl		= gameControl;
     this.scriptObject		= null;
     this.compiledAssembly	= null;
     this.scriptMethods		= new Dictionary<string, MethodInfo>();
 }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:10,代码来源:ScriptRunner.cs

示例9: Player

 public Player(List<Card> deck, GameControl gameControl)
 {
     Deck = deck;
     Hand = new List<Card>();
     GuiHand = new List<GUICard>();
     this.gameControl = gameControl;
 }
开发者ID:AndersHqst,项目名称:Battle-For-Betelgeuse,代码行数:7,代码来源:Player.cs

示例10: Start

	// Use this for initialization
	void Start () {
		box = new GameObject[texture.Length];
		gameControl = GameObject.Find("GameControl").GetComponent("GameControl") as GameControl; 
		gp = GameObject.Find("GameControl").GetComponent<GamePlay>(); 

		endPoint = gameControl.stopCharacterX + 2.2F;
	}
开发者ID:MizzKii,项目名称:PuruDash2D,代码行数:8,代码来源:WallRealTime.cs

示例11: OnPointerDown

    public void OnPointerDown(PointerEventData data)
    {
        gc = (GameControl)GameObject.FindWithTag("GameController").GetComponent<GameControl>();
        GameObject parent = gameObject.transform.parent.gameObject;

        for(int i=0; i<gc.player.cards.Count; i++)
        {
            if(gc.player.cards[i].picture == parent)
            {
                card = gc.player.cards[i];
            }
        }
        for(int i=0; i<gc.computer.cards.Count; i++)
        {
            if(gc.computer.cards[i].picture == parent)
            {
                card = gc.computer.cards[i];
            }
        }
         	email = PlayerPrefs.GetString ("email", "");
        if (!email.Contains ("@"))
        {
            gc.ShowEmail();
            StartCoroutine(WaitForEmail());
        }
        else StartCoroutine(SendMail());
    }
开发者ID:MeowTheCat,项目名称:blackjack,代码行数:27,代码来源:EmailBehavior.cs

示例12: Start

 // Use this for initialization
 void Start()
 {
     ballcolor = new BallColor(Material1, Material2, renderer);
     scoreboard = new Scoreboard();
     gameControl = new GameControl();
     startPos = transform.position;
 }
开发者ID:Janin-K,项目名称:SG,代码行数:8,代码来源:Ball.cs

示例13: Start

	void Start () {
		gameControl = GameObject.Find("GameControl").GetComponent("GameControl") as GameControl;
		gp			= GameObject.Find("GameControl").GetComponent<GamePlay>();
		speedControl = gameControl.speedControl;
		CountSpeedUp = gp.countSpeedUp;
		SpeedUp = gp.speedUp;
	}
开发者ID:MizzKii,项目名称:PuruDash2D,代码行数:7,代码来源:GUISetting.cs

示例14: StartEvent

	public void StartEvent(float x, float y) {
		character = GameObject.Find("CharacterControl").GetComponent("CharacterControl") as CharacterControl;
		gameControl = GameObject.Find("GameControl").GetComponent("GameControl") as GameControl; 
		gameControl.eventRun = true;
		eventObject = Instantiate(Ice,new Vector3(x, y, -2F),Quaternion.Euler(0f,0f,0f)) as GameObject;
		step = 1;
	}
开发者ID:MizzKii,项目名称:PuruDash2D,代码行数:7,代码来源:IceRealTime.cs

示例15: StartEvent

	public void StartEvent(float x, float y) {
		gameControl = GameObject.Find("GameControl").GetComponent("GameControl") as GameControl; 
		gameControl.eventRun = true;
		eventObject = Instantiate(pricker,new Vector3(x, y - pricker.transform.localScale.y/2-0.5F, -2F),Quaternion.Euler(90f,180f,0f)) as GameObject;
		height = y + pricker.transform.localScale.y/2 -0.5F;
		step = 1;
	}
开发者ID:MizzKii,项目名称:PuruDash2D,代码行数:7,代码来源:PrickerRealTime.cs


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