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

C# PlayerControl类代码示例

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

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



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

示例1: MyStart

 void MyStart()
 {
     myRigid2D = this.GetComponent<Rigidbody2D>();
     GameObject player = GameObject.FindWithTag("Player");
     playCon = player.GetComponent<PlayerControl>();
     anim = this.GetComponent<Animator>();
 }
开发者ID:huanzheWu,项目名称:Purity-Cat-_Unity3D-Game,代码行数:7,代码来源:Cell.cs


示例2: Setup

	public override void Setup(GameObject player) {
		this.player = player;
		playerControl = player.GetComponent<PlayerControl> ();
		originalJump = playerControl.jumpSpeed;
		originalMoveSpeed = playerControl.airControl;
		activationStatus = player.GetComponent<PlayerNotification> ();
	}
开发者ID:tediris,项目名称:CS194GameDev,代码行数:7,代码来源:PetJumpBoost.cs


示例3: Awake

 void Awake()
 {
     // Setting up the references.
     anim = transform.root.gameObject.GetComponent<Animator>();
     playerCtrl = transform.root.GetComponent<PlayerControl>();
     rocket = rocketGO.rigidbody2D;
 }
开发者ID:wang10998588,项目名称:qjsbunitynew,代码行数:7,代码来源:Gun.cs


示例4: Start

 // Use this for initialization
 void Start()
 {
     player = GameObject.Find("Player");
     playerScript = player.GetComponent<PlayerControl> ();
     pickedUp = false;
     //canThrow = true;
 }
开发者ID:SisWorker,项目名称:Sisyphus,代码行数:8,代码来源:PickUpObject.cs


示例5: Start

 // Use this for initialization
 void Start()
 {
     gameMaster = Camera.main.GetComponent<GameMaster> ();
     playerControl = Camera.main.GetComponent<PlayerControl> ();
     stats = Camera.main.GetComponent<Statistics> ();
     source = Camera.main.GetComponent<AudioSource> ();
 }
开发者ID:NikMifsud,项目名称:GreatSiege,代码行数:8,代码来源:SpawnSiege.cs


示例6: StartSpeech

    public void StartSpeech(GameObject initiator)
    {
        if (showingText)
        {
            return;
        }

        if (randomizeTexts)
        {
            textIndex = Random.Range(0, texts.Length - 1);
        }

        if (initiator.CompareTag(playerTag))
        {
            playerControl = initiator.GetComponent<PlayerControl>();
            playerControl.freezeInput = true;
            speech.SetActive(true);

            showingText = true;
            skipUpdate = true;
            textAdvancer = initiator.GetComponent<TextAdvancer>();

            DrawText();
        }
    }
开发者ID:BlazingMammothGames,项目名称:LD29,代码行数:25,代码来源:SpeechController.cs


示例7: Awake

    private void Awake()
    {
        // Master
        MasterView viewMaster = Instantiate( masterView );
        viewMaster.Initialize( gameSetting.masterSetting );
        Master master = new Master( viewMaster );
        MasterAIControl masterControl = new MasterAIControl( master );

        // AI
        List<AIControl> AIControlList = new List<AIControl>();
        List<Character> AICharacter = new List<Character>();
        for ( int i = 0; i < AINumber; ++i )
        {
            CharacterView view = Instantiate( characterPrefab );
            view.Initialize( gameSetting.characterSetting );
            Character character = new Character( view );
            AIControl aiControl = new AIControl( gameSetting.AIControlSetting, character, master );
            AIControlList.Add( aiControl );
            AICharacter.Add( character );
        }

        // Player
        CharacterView playerView = Instantiate( characterPrefab );
        playerView.Initialize( gameSetting.characterSetting );
        Character player = new Character( playerView );
        PlayerControl playerControl = new PlayerControl( player, AICharacter );

        GameTime gameTime = new GameTime();
        controllerManager = new ControllerManager(playerControl, AIControlList, masterControl);
        gameManager = new GameManager( gameTime, controllerManager, player, AICharacter, master );

        successPanel.SetGameTime( gameTime );
    }
开发者ID:ted10401,项目名称:project-ggj2016,代码行数:33,代码来源:CompositionRoot.cs


示例8: Start

 void Start()
 {
     playerControl = GameObject.FindGameObjectWithTag(TagManager.PLAYER).GetComponent<PlayerControl>();
     vomit = GameObject.FindGameObjectWithTag("Vomit").GetComponent<ParticleSystem>();
     switcher = gameObject.GetComponent<CameraSwitcher>();
     audio.clip = vomitSound;
 }
开发者ID:Rameos,项目名称:PSMG_Team_Gameboys,代码行数:7,代码来源:Vomiting.cs


示例9: Start

    //private bool destroyed = false;

    void Start(){
        soundManager = gameObject.GetComponentInChildren<SoundManager>();

        energy = maxEnergy;
        score = FindObjectOfType(typeof(ScoreKeeper)) as ScoreKeeper;

        playerControl = gameObject.GetComponentInChildren<PlayerControl>();
        playerGUI = gameObject.GetComponentInChildren<PlayerGUI>();
        playerHealth = gameObject.GetComponentInChildren<PlayerHealth>();
        thrust = gameObject.GetComponentInChildren<Thrust>();
        
        shield = gameObject.AddComponent<Shield>() as Shield;
        shield.PDelegate = this;


        foreach(Weapon weapon in gameObject.GetComponentsInChildren(typeof(IWeapon))){
            if(weapon.gameObject.name == "Left weapon"){
                leftWeapon = weapon;
                leftWeapon.soundManager = soundManager;
            }else if(weapon.gameObject.name == "Right weapon"){
                rightWeapon = weapon;
                rightWeapon.soundManager = soundManager;
            }
        }
        StartCoroutine("RegenerateEnergy");
    }
开发者ID:biikatto,项目名称:zeroweight,代码行数:28,代码来源:PlayerDelegate.cs


示例10: PlayerParty

	public PlayerParty(PlayerControl control)
	{
		Members = new List<HumanCharacter>();
		_playerControl = control;


	}
开发者ID:rotorist,项目名称:Warzone,代码行数:7,代码来源:PlayerParty.cs


示例11: Update

    // Update is called once per frame
    void Update()
    {
        if(player == null)
        {
            var players = FindObjectsOfType<PlayerControl>();
            player = players.FirstOrDefault(x => (int)x.PlayerIndex == PlayerIndex);

        }

        if(player != null)
        {
            var damageable = player.GetComponent<Damageable>();
            var health = Mathf.Clamp(damageable.Health / damageable.StartingHealth, 0, 1);
            healthBar.localScale = new Vector3(health, 1, 1);

            if(player.CurrentWeapon == null)
                weaponLabel.text = "";
            else
            {
                weaponLabel.text = player.CurrentWeapon.GetPickupName();
                var ammo = player.CurrentWeapon.GetAmmoCount();
                if(ammo > -1)
                    weaponLabel.text += " " + ammo;
            }

            score.text = GameState.Players[player.PlayerIndex].RoundScore.ToString();
        }
    }
开发者ID:PeteJBB,项目名称:SupremeViolence,代码行数:29,代码来源:PlayerHud.cs


示例12: Awake

 void Awake()
 {
     // Setting the current health when the player first spawns.
     currentHealth = startingHealth;
     playerControlScript = GetComponent<PlayerControl> ();
     godMode = false;
 }
开发者ID:dulb640,项目名称:angrygoats,代码行数:7,代码来源:PlayerHealth.cs


示例13: Awake

    private PlayerControl playerCtrl; // Reference to the PlayerControl script.

    #endregion Fields

    #region Methods

    void Awake()
    {
        // Setting up the references.
        playerCtrl = transform.parent.GetComponent<PlayerControl>();
        Rigidbody2D bulletInstance = Instantiate(ammo, transform.position, Quaternion.Euler(new Vector3(0,0,0))) as Rigidbody2D;
        bulletInstance.velocity = new Vector2(speed, 0);
    }
开发者ID:swampfish,项目名称:Platformer,代码行数:13,代码来源:Gun.cs


示例14: Update

 // Update is called once per frame
 public virtual void Update()
 {
     if (player == null)
     {
         player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>();
     }
 }
开发者ID:andresg6,项目名称:Left4Bread,代码行数:8,代码来源:Base.cs


示例15: Start

 // Use this for initialization
 void Start()
 {
     playerControl = Camera.main.GetComponent<PlayerControl> ();
     source = Camera.main.GetComponent<AudioSource> ();
     gameMaster = Camera.main.GetComponent<GameMaster> ();
     timer = 45;
 }
开发者ID:NikMifsud,项目名称:GreatSiege,代码行数:8,代码来源:HealthPowerUps.cs


示例16: Start

 // Use this for initialization
 void Start()
 {
     this.touchControl = new TouchControl(isTouchDevice);
     this.playerControl = new PlayerControl(this);
     this.target = GameObject.FindGameObjectWithTag("Target");
     this.UIControl = this.GetComponent<UIControl>();
 }
开发者ID:Charlemagne3,项目名称:Ricochet,代码行数:8,代码来源:GameControl.cs


示例17: StateWallmasterChasing

 public StateWallmasterChasing(Wallmaster _w, PlayerControl _p, SpriteRenderer _renderer, Sprite[] _animation) {
     w = _w;
     p = _p;
     rb = w.GetComponent<Rigidbody>();
     renderer = _renderer;
     animation = _animation;
 }
开发者ID:ConnorUllmann,项目名称:EECS494_Proj1,代码行数:7,代码来源:Wallmaster.cs


示例18: Awake

    void Awake()
    {

        // Setting up references.
        groundCheck = transform.Find("groundCheck");
        anim = GetComponent<Animator>();

        bazooka = GameObject.FindGameObjectWithTag("bazooka2");
        facingRight = true;

        sgn = 1;
        time = 30;
        move = 20;
        idle = 0;

        obj = GameObject.Find("hero");
        script = obj.GetComponent<PlayerControl>();
        cnt = script.sgn;

        startt = bazooka.transform.localEulerAngles;
        bazooka.transform.Rotate(-180, 0, 0);
        end = bazooka.transform.localEulerAngles;

        bazooka.transform.Rotate(180, 0, 0);
    }
开发者ID:cristighr1995,项目名称:Meninist,代码行数:25,代码来源:PlayerControl2.cs


示例19: Awake

	void Awake()
	{
		// Setting up the references.
		anim = this.GetComponentInParent<Animator>();
		playerCtrl = this.GetComponentInParent<PlayerControl>();
		rgbody = this.GetComponentInParent<Rigidbody2D> ();
	}
开发者ID:vascofg,项目名称:gamejam-2015,代码行数:7,代码来源:Gun.cs


示例20: Start

 /// <summary>
 /// 进入游戏关卡后,点击游戏开始的start按钮
 /// </summary>
 void Start()
 {
     startBackground = GameObject.Find("startBackground");
  
     Gplayer = GameObject.Find("Player");
     Splayer = Gplayer.GetComponent<PlayerControl>();
 }
开发者ID:huanzheWu,项目名称:Purity-Cat-_Unity3D-Game,代码行数:10,代码来源:ButtonEvent.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# PlayerController类代码示例发布时间:2022-05-24
下一篇:
C# PlayerColor类代码示例发布时间: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