• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GameController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Start

    // Use this for initialization
    void Start()
    {
        _gameControllerRef = this.GetComponent<GameController>();
        eyeClient = GameObject.FindGameObjectWithTag("EyeTribeHandler").GetComponent<EyeTribeClient>();

        playerRef = _gameControllerRef.players[0].GetComponent<PlayerController>();
    }
开发者ID:RamiAhmed,项目名称:R2R_Test2,代码行数:8,代码来源:MouseTracker.cs


示例2: Start

 void Start()
 {
     GameObject gameControllerObject = GameObject.FindWithTag ("GameController");
     if (gameControllerObject != null) {
         gameController = gameControllerObject.GetComponent<GameController>();
     }
 }
开发者ID:prathamtandon,项目名称:space-shooter,代码行数:7,代码来源:DestroyByContact.cs


示例3: Turn

        public override void Turn(GameController controller, System.Drawing.Point location)
        {
            base.Turn(controller, location);
            var playerLocation = controller.PlayerLocation;

            Active = playerLocation.X == location.X || playerLocation.Y == location.Y;
        }
开发者ID:randrews,项目名称:puzzlegame,代码行数:7,代码来源:Skull.cs


示例4: SceneSwitchers

 public void SceneSwitchers(int target)
 {
     //consider using this for level load stat
     controller = GameObject.Find("GameController"); //finds gamecontroller
     control = controller.GetComponent<GameController>();
     control.SceneSwitchers(target);
 }
开发者ID:Afternight,项目名称:Orbit,代码行数:7,代码来源:SceneSwitchLocal.cs


示例5: Start

    // Use this for initialization
    void Start()
    {
        game = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameController>();
        mainCam = GameObject.FindWithTag("MainCamera").camera;

        rezzSpot = GameObject.FindWithTag("Player");
    }
开发者ID:BjarkeHou,项目名称:ProjectGuard,代码行数:8,代码来源:Interface.cs


示例6: Start

 // Use this for initialization
 void Start()
 {
     thePlayer = GameObject.FindGameObjectWithTag ("Player");
     gameController = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameController> ();
     randomDelay = Random.Range (0, 2);
     nextSpawn = Time.time + randomDelay;
 }
开发者ID:jrmullins,项目名称:ludumdare29,代码行数:8,代码来源:Spawner.cs


示例7: Load

    public void Load(string path)
    {
        if(File.Exists(Application.persistentDataPath + path))
        {
            BinaryFormatter binaryFormatter = new BinaryFormatter();
            FileStream file = File.Open(Application.persistentDataPath + path, FileMode.Open);

            //deserializing the file so we can get the values back
            SaveData saveData = binaryFormatter.Deserialize(file) as SaveData;

            //get all components
            GameObject gameController = GameObject.FindGameObjectWithTag(Tags.GAMECONTROLLER);
            _gameController = gameController.GetComponent<GameController>();

            //setting all values
            _gameController.level = saveData.level;
            _gameController.lives = saveData.lives;
            _gameController.checkpointPosition = saveData.checkpointPosition;
            _gameController.score = saveData.score;
            _gameController.goldCoins = saveData.goldCoins;

            //closing the file after every value is set
            file.Close();
            if (OnGameLoaded != null)
                OnGameLoaded();
        }
        else
        {
            if (OnNewGame != null)
                OnNewGame();
            //new game
        }
        SavePaths.currentPath = path;
    }
开发者ID:mennolp098,项目名称:Boom-Boom-Boomerang,代码行数:34,代码来源:SaveLoadDataSerialized.cs


示例8: Start

    void Start()
    {
        gameController = GameObject.Find("GameController").GetComponent<GameController>();

        if (gameController.startingLives - gameController.currentLives != 0)
            transform.position = gameController.oldCameraPosition;
    }
开发者ID:flofilessrraamm,项目名称:Poly-Games,代码行数:7,代码来源:Camera1_follow.cs


示例9: Start

 void Start()
 {
     controller = GameObject.Find("Controllers").GetComponent<GameController>();
     cageRenderer = GetComponentInChildren<Renderer>();
     cageUI = GetComponentInChildren<Canvas>();
     startColor = cageRenderer.material.color;
 }
开发者ID:alexwaslike,项目名称:lovebirds,代码行数:7,代码来源:CageObj.cs


示例10: Start

	void Start()
    {
        gc = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameController>();
        navMeshAgent = this.gameObject.GetComponent<NavMeshAgent>();
        groundBoundsBox = GameObject.FindGameObjectWithTag("GroundBounds");
        SwapSpriteUp();
    }
开发者ID:nathansizemore,项目名称:ggj-2016,代码行数:7,代码来源:OtherChicken.cs


示例11: Awake

 protected void Awake()
 {
     if (Game == null) {
         Game = GameController.Instance;
         configs = Config.GetConfigs();
     }
 }
开发者ID:sagivo,项目名称:Unity2d-Game,代码行数:7,代码来源:BaseObj.cs


示例12: Start

	void Start () 
	{
		gamecontroller = FindObjectOfType (typeof(GameController)) as GameController;
		anim = GetComponentInChildren<Animator> ();
		rgd2Player = GetComponent<Rigidbody2D> ();
		check = GameObject.Find ("Check").gameObject.transform;
	}
开发者ID:CriandoGames,项目名称:unity5-Projeto-Corrida-Infinita,代码行数:7,代码来源:PlayerBehaviour.cs


示例13: Start

 // Use this for initialization
 void Start()
 {
     anim = GetComponent<Animator> ();
     gc = (GameController) FindObjectOfType(typeof(GameController));
     door = GameObject.FindWithTag ("Door");
     anim.enabled = false;
 }
开发者ID:kylelin47,项目名称:paratrooper,代码行数:8,代码来源:DoorAnimation.cs


示例14: OnButtonStateChanged

        protected void OnButtonStateChanged(GameController.ControllerNumber cNum, GameController.Buttons button, bool pressed)
        {
            if (!_paused)
            {
                // Take into account special cases:
                // 1. Thumbsticks are mouse clicks in cursor mode
                if (_cursorMode && button == GameController.Buttons.LeftStick)
                {
                    UnsafeWin32Calls.SendMouseClick(_cursorPositionX, _cursorPositionY, System.Windows.Input.MouseButton.Left, pressed);
                    return;
                }
                if (_cursorMode && button == GameController.Buttons.RightStick)
                {
                    UnsafeWin32Calls.SendMouseClick(_cursorPositionX, _cursorPositionY, System.Windows.Input.MouseButton.Right, pressed);
                    return;
                }

                KeyBinding kb = _settings.KeyBindings.GetKeyBinding(_triggersPressed, button);

                // 2. Swap look/cursor mode
                if (pressed && kb.KeyBoardKey == System.Windows.Input.Key.Attn)
                {
                    _cursorMode = !_cursorMode;
                    return;
                }

                // Handle normal key clicks
                UnsafeWin32Calls.PostKeyClick(kb.KeyBoardKey, kb.Modifier, pressed);
            }
        }
开发者ID:glenstevens,项目名称:bendablemedium,代码行数:30,代码来源:WoWLogic.cs


示例15: Awake

 void Awake()
 {
     game = FindObjectOfType<GameController>();
     gravityBoxes = transform.Find("GravityBoxes").GetComponentsInChildren<LogicGravityBox>();
     floatyBoxes = transform.Find("FloatyBoxes").GetComponentsInChildren<Rigidbody>();
     floatyCables = transform.Find("FloatyCables").GetComponentsInChildren<LogicCable>();
 }
开发者ID:zehro,项目名称:Projects,代码行数:7,代码来源:Blue3Controller.cs


示例16: Start

 // Use this for initialization
 void Start()
 {
     gamecontroller = GameObject.Find ("GameController").GetComponent<GameController>();
     LeanTouch.OnFingerSwipe = (LeanFinger finger)=>{
         moveCommond.x = finger.SwipeDelta.x;
         moveCommond.y = finger.SwipeDelta.y;
         if(Mathf.Abs(moveCommond.x) >= Mathf.Abs(moveCommond.y))
         {
             moveCommond.y = 0;
             if(moveCommond.x > 0)
             {
                 moveCommond.x = 1;
             }else
             {
                 moveCommond.x = -1;
             }
         }else
         {
             moveCommond.x = 0;
             if(moveCommond.y > 0)
             {
                 moveCommond.y = 1;
             }else
             {
                 moveCommond.y = -1;
             }
         }
         gamecontroller.moveCommond(moveCommond);
     };
 }
开发者ID:yizhengtutu,项目名称:snakeX,代码行数:31,代码来源:InputHandle.cs


示例17: Awake

    void Awake()
    {
        gc = GameObject.FindWithTag("GameController").GetComponent<GameController>();

        cc = GetComponent<CharacterController>();
        move = new Vector3();
    }
开发者ID:EternalGB,项目名称:ldjam33,代码行数:7,代码来源:PlayerController.cs


示例18: Console

        public Console(GameController game)
        {
            this.game = game;
            this.InitializeComponent();

            init();
        }
开发者ID:philyum,项目名称:TheAmazingFishy,代码行数:7,代码来源:Console.xaml.cs


示例19: Start

    void Start()
    {
        // Game controller object set up
        GameObject gameControllerObject = GameObject.FindWithTag ("GameController");

        if (gameControllerObject != null)
        {
            gameController = gameControllerObject.GetComponent<GameController>();
        }

        if (gameControllerObject == null)
            Debug.Log ("Cannot find 'GameController' script");

        // Player controller object setup
        GameObject playerControllerObject = GameObject.FindWithTag("Player");

        if (playerControllerObject != null)
        {
            playerController = playerControllerObject.GetComponent<PlayerController>();
        }

        if (playerControllerObject == null)
            Debug.Log("Cannot find 'PlayerController' script");

        //GameObject playerControllerObject = GameObject.Find("Player");
        //playerController = (PlayerController)playerControllerObject.GetComponent(typeof(PlayerController));
    }
开发者ID:robnils,项目名称:Space-Shooter,代码行数:27,代码来源:DestroyByContact.cs


示例20: MainForm

        public MainForm()
        {
            SuspendLayout();

            _humanBoard = new Board();
            _computerBoard = new Board(false);

            _humanPlayer = new HumanPlayer("You", _computerBoard);
            _computerPlayer = new ComputerPlayer("Computer");

            _scoreboard = new ScoreBoard(_humanPlayer, _computerPlayer, 10, 100);
            _controller = new GameController(_humanPlayer, _computerPlayer, _humanBoard, _computerBoard, _scoreboard);

            _shuffleButton = CreateButton(ShuffleCharacter.ToString(), ButtonBackColor);
            _newGameButton = CreateButton(NewGameCharacter.ToString(), ButtonBackColor);
            _startGameButton = CreateButton(StartGameCharacter.ToString(), ButtonBackColor);

            SetupWindow();
            LayoutControls();

            _scoreboard.GameEnded += OnGameEnded;

            _shuffleButton.Click += OnShuffleButtonClick;
            _startGameButton.Click += OnStartGameButtonClick;
            _newGameButton.Click += OnNewGameButtonClick;

            ResumeLayout();

            StartNewGame();
        }
开发者ID:Time-2Go,项目名称:Sea-Battle-Game,代码行数:30,代码来源:MainForm.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GameData类代码示例发布时间:2022-05-24
下一篇:
C# GameControl类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap