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

C# PlayerScript类代码示例

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

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



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

示例1: Start

 // Use this for initialization
 void Start()
 {
     showScoreAdded = false;
     score = 0f;
     _playerScript = GameObject.Find("Player").GetComponent<PlayerScript>();
     scorePerSecond = 1f;
 }
开发者ID:Breinss,项目名称:GameMechanics,代码行数:8,代码来源:ScoreHandler.cs


示例2: Start

 // Use this for initialization
 void Start()
 {
     this.koopaShellScript = this.transform.parent.GetComponent<KoopaShellScript> ();
     this.player = GameObject.FindWithTag ("Player");
     this.playerScript = this.player.GetComponent<PlayerScript>();
     this.playerRb = this.player.GetComponent<Rigidbody2D>();
 }
开发者ID:pedronalbert,项目名称:maduro-bros-unity,代码行数:8,代码来源:KoopaShellHitAreaScript.cs


示例3: Awake

 void Awake()
 {
     if (spawnVectors.Length > 0)
     {
         for (int i = 0; i < spawnVectors.Length; i++)
         {
             if (spawnVectors[i].GetComponent<SpawnVectorScript>() == null)
             {
                 Debug.Log("SpawnVector GameObject No." + i + " does not have the required script Attached.");
                 errorHasOccured = true;
                 break;
             }
         }
         if (!errorHasOccured)
         {
             for (int i = 0; i < spawnVectors.Length - 1; i++)
             {
                 spawnVectors[i].Direction(spawnVectors[i + 1].transform.position);
             }
         }
         else
             Debug.Log("Fix the error before continuing playing the game.");
     }
     player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerScript>();
     playerEmo = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<PlayerEmotions>();
     spawn = spawnVectors[0].transform.position;
 }
开发者ID:WishPotato,项目名称:MED6Game,代码行数:27,代码来源:SpawnPointAdjustmentScript.cs


示例4: Purchase

    public void Purchase()
    {
        if (PortShopManager.Instance.DockedShip.Gold < Cost) return;

        PortShopManager.Instance.DockedShip.Gold -= Cost;
        Owner = PlayerScript.MyPlayer;
    }
开发者ID:Syldarion,项目名称:DJD-JP,代码行数:7,代码来源:ResourceGenerator.cs


示例5: Start

 // Use this for initialization
 void Start()
 {
     GameObject playerGO = GameObject.FindWithTag ("Player");
     if (playerGO != null) {
         player = playerGO.GetComponent<PlayerScript>();
     }
 }
开发者ID:MeesterMarcus,项目名称:Adv-Soft-Engineering-Project,代码行数:8,代码来源:OptionScript.cs


示例6: AdquireJogadores

    public void AdquireJogadores()
    {
        /*
        players= GameObject.FindGameObjectsWithTag ("jogador");

        foreach (GameObject atual in players) {

            atual.GetComponent<PlayerScript> ().posicao_atual = 2;
            scriptsplayers.Add (atual.GetComponent<PlayerScript> ());
        }
        num_players = scriptsplayers.Count;
        player_atual = players [0];
        */

             GameObject[] temp = GameObject.FindGameObjectsWithTag ("jogador");

        players = new GameObject[temp.Length];

        foreach (GameObject atual in temp) {

            players [atual.GetComponent<PlayerScript> ().ordem] = atual;

            atual.GetComponent<PlayerScript> ().posicao_atual = 1;
            //	scriptsplayers.Add (atual.GetComponent<PlayerScript> ());
        }
        //num_players = scriptsplayers.Count;
        player_atual = players [0];
        addFlagPLayerAtual ();
        Atualizar_Texto ();
        script_atual = player_atual.GetComponent<PlayerScript> ();
        num_players = players.Length;
    }
开发者ID:junior1407,项目名称:Joguinho-Church,代码行数:32,代码来源:GameBoardController.cs


示例7: Start

    void Start()
    {
        parent = GameObject.Find("Charger").GetComponent<Collider>();
        player = GameObject.Find("Player").GetComponent<PlayerScript>();

        myCollider = gameObject.GetComponent<Collider>();
    }
开发者ID:Andrewnopoulos,项目名称:StrainAlpha,代码行数:7,代码来源:BossCharge.cs


示例8: Start

 // Use this for initialization
 void Start()
 {
     camera.orthographicSize = CurrentZoom;
     GameObject test;
     test = GameObject.Find ("PlayerObject");
     playerscript = test.GetComponent<PlayerScript>();
 }
开发者ID:Thebluemage2,项目名称:Game,代码行数:8,代码来源:CameraMovement.cs


示例9: Start

 void Start()
 {
     //ph = GameObject.Find ("PlanetHandler").GetComponent<PlanetHandler> ();
     //ph.SetOxygenLevel (100);
     ps = GameObject.FindWithTag ("Player").GetComponent<PlayerScript> ();
     ps.onAirArea = true;
 }
开发者ID:Jellezilla,项目名称:AliensVsMofos,代码行数:7,代码来源:Terraformer.cs


示例10: Awake

    void Awake()
    {
        VariableResourcesScript vrs = GetComponent<VariableResourcesScript>();

        players = GameObject.FindGameObjectsWithTag("Player");

        objPlayer1 = vrs.objPlayer1;
        scrPlayerScript1 = objPlayer1.GetComponent<PlayerScript>();
        scrPlayerExperience1 = objPlayer1.GetComponent<PlayerStats>();
        scrPlayerHealthScript1 = objPlayer1.GetComponent<PlayerHealthScript>();
        scrPlayerShoot1 = objPlayer1.GetComponent<PlayerShoot>();
        //objPlayer2 = vrs.objPlayer2;

        playersTag = objPlayer1.tag;
        // 8: Enemy, 15: Spawn Point, 20: Flying, 24: Neutral, 25: Immune
        intEnemyLayerMask = 1 << LayerMask.NameToLayer("Enemy") | 1 << LayerMask.NameToLayer("Flying") | 1 << LayerMask.NameToLayer("Neutral") | 1 << LayerMask.NameToLayer("Immune") | 1 << LayerMask.NameToLayer("Spawn Point");
        intHostileLayerMask = 1 << LayerMask.NameToLayer("Enemy") | 1 << LayerMask.NameToLayer("Spawn Point") | 1 << LayerMask.NameToLayer("Immune");
        intPlayerUnitsLayerMask = 1 << LayerMask.NameToLayer("Player");

        objBullet = vrs.objBullet;
        objExplodingShot = vrs.objExplodingShot;
        objArrow = vrs.objArrow;
        objFire = vrs.objFire;
        objExplosion = vrs.objExplosion;

        objTemp = vrs.objTemp;

        objText = vrs.objText;

        texAttribute = vrs.texAttribute;

        matLineOfSightSolid = vrs.matLineOfSight;
        matLineOfSightTransparent = vrs.matLineOfSightTransparent;
        matSkull = vrs.matSkull;
    }
开发者ID:hwchan,项目名称:new-kite,代码行数:35,代码来源:VariableScript.cs


示例11: Awake

    private PlayerScript m_Player; //Référence au script playerScript

    #endregion Fields

    #region Methods

    // Use this for initialization
    void Awake()
    {
        //Initialise les références
        m_Player = GameObject.Find("Character").GetComponent<PlayerScript>();
        m_AtTopCheck = transform.Find("Top");
        m_AtBotCheck = transform.Find("Bot");
    }
开发者ID:NokiDev,项目名称:Projet-Zoulou,代码行数:14,代码来源:VerticalClimbing.cs


示例12: Start

 void Start() {
     player = GameObject.FindWithTag( "Player" ).GetComponent<PlayerScript>();
     opNumSet = GetComponent<OperatorNumberSetScript>();
     opNumSet.operatorSide = operatorSide;
     StartCoroutine( UpdateNumberRenderer() );
     StartCoroutine( Move() );
 }
开发者ID:GDR2014,项目名称:february-Math,代码行数:7,代码来源:EnemyScript.cs


示例13: RemoveMe

 protected override void RemoveMe(PlayerScript ps)
 {
     if(ps!=null){
         GUIManager.FloatingTexture(meleeEffect,((ps.transform.position+transform.position)*.5f),.3f,4,1,0,0,4,12);
     }
     Destroy(gameObject);
 }
开发者ID:hwchan,项目名称:new-kite,代码行数:7,代码来源:MeleeProjectileScript.cs


示例14: Start

    // Use this for initialization
    void Start()
    {
        _PlayerSt = GameObject.FindWithTag("player").GetComponent<PlayerScript>();
        _PlayerSt._attackChkCol = gameObject.GetComponent<BoxCollider>();

        gameObject.GetComponent<BoxCollider>().enabled = false;
    }
开发者ID:KimDaeYong123,项目名称:New-Unity-Project,代码行数:8,代码来源:PlayerAttackScript.cs


示例15: Start

 // Use this for initialization
 void Start()
 {
     Player = (GameObject) GameObject.FindWithTag ("Player");
     playerScript = (PlayerScript) Player.gameObject.GetComponent(typeof(PlayerScript));
     gameTime = 0;
     portalScript = (PortalScript) GameObject.Find("Portal").GetComponent(typeof(PortalScript));
 }
开发者ID:jrsescon,项目名称:AffectDDATopDown,代码行数:8,代码来源:VariableScript.cs


示例16: Start

 // Use this for initialization
 void Start()
 {
     GameObject target = GameObject.FindWithTag ("Player");
     GameObject player = GameObject.FindWithTag ("Player");
     playerScript =  player.GetComponent<PlayerScript>();
     playerTr = player.transform;
 }
开发者ID:MeesterMarcus,项目名称:Adv-Soft-Engineering-Project,代码行数:8,代码来源:Follow.cs


示例17: addScore

 public static void addScore(PlayerScript player, int score)
 {
     if (player == script0)
         playerScore0 += score;
     else if(player == script1)
         playerScore1 += score;
 }
开发者ID:jarllarsson,项目名称:minild63,代码行数:7,代码来源:ScoreManager.cs


示例18: Start

    private void Start()
    {
        Player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerScript>();

        MessageBox.SetActive (false);
        OtherMessageBox.SetActive (false);
    }
开发者ID:C453,项目名称:SOLAR,代码行数:7,代码来源:GameScreen.cs


示例19: Update

    void Update()
    {
        if(p1 == null)
        {
            p1 = GameObject.FindGameObjectWithTag("PLAYER1");
            if(p1 != null)
                player1 = p1.GetComponent<PlayerScript>();
        }
        if(p2 == null)
        {
            p2 = GameObject.FindGameObjectWithTag("PLAYER2");
            if(p2 != null)
                player2 = p2.GetComponent<PlayerScript>();
        }

        if(p1 == null || p2 == null)
            return;

        GameObject[] blackHoles = GameObject.FindGameObjectsWithTag("blackhole");
        foreach(GameObject bh in blackHoles)
        {
            BlackHoleScript blackHoleScript = bh.GetComponent<BlackHoleScript>();
            if(Network.isServer)
                player1.UpdateAgainstBlackHole(blackHoleScript);
            else if(Network.isClient)
                player2.UpdateAgainstBlackHole(blackHoleScript);
        }

        if(blackHoles.Length == 0)
            GameLogicController.instance.MoveToNextLevel();
    }
开发者ID:edwonia,项目名称:Not-Alone,代码行数:31,代码来源:Level_2.cs


示例20: Awake

 void Awake()
 {
     playerScript = GameObject.Find("Player").GetComponent<PlayerScript>();
     spriteRenderer = gameObject.GetComponent<SpriteRenderer>();
     objectRigidbody = GetComponent<Rigidbody2D>();
     debugScript = GetComponent<dynamicObjectDebug>();
 }
开发者ID:ponJuice,项目名称:RunGame,代码行数:7,代码来源:dynamicObjectScript.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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