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


C# PlayerManager.getPlayers方法代码示例

本文整理汇总了C#中PlayerManager.getPlayers方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerManager.getPlayers方法的具体用法?C# PlayerManager.getPlayers怎么用?C# PlayerManager.getPlayers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PlayerManager的用法示例。


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

示例1: Update

    // Update is called once per frame
    void Update()
    {
        base.Update();
        if (spawnM)
        {
            playerM = FindObjectOfType<PlayerManager>();
            players = playerM.getPlayers();
            size = players.Length;
            threatLevel = damageDealt = players;
            damageDealt = new Player[size];
            for (int i = 0; i < size; i++)
            {
                players[i].Reset();
            }
            one = two = three = four = 0;
            tempThreat = 0;
            tempDamage = 0;
            temp1 = 0;
            temp2 = 0;

            Grouper.setPlayerGroup(players, size);

            grouping = false;
            getPlayerType();

            int initialTarget = UnityEngine.Random.Range(0, size);
            target = players[initialTarget].gameObject;
            spawnM = false;
        }
        targetPos = target.transform.position;
        CalcDirection();

        if (refresh)
        {
            Debug.Log(ranged + " " + grouping + " " + melee + " " + support);
            refresh = false;
        }

        if (teleClawStage > 0)
        {
            teleClawUpdate();
        }

        if (isTeleporting)
        {
            //ANIMATION STUFF~~~~~~~~~~~~~~~~~
            //How teleport works: transform to swarm -> isTel = true, swarm animations for moving around (same as
            //normal swarm animations, low speed = circular, high speed = more horizontal, accel one way + low speed other way = turning
            //remember to switch x scale on turn) -> isTel = false, transform to malady.
            //if tele claw, then claw, tele process to new location (original unless people are clumping there)
            //positions are already put in with a set time taken to get everywhere (lerp, teleduration, below) so animations have a set time

            //ANIMATION STUFF~~~~~~~~~~~~~~~~~ isTeleporting set to true at end of transforming into swarm animation
            //ANIMATION STUFF~~~~~~~~~~~~~~~~~ invincible set to true at start of transforming into swarm animation
            transform.position = Vector3.Lerp(startPos, teleTarget, teleDuration);
            if (lerpDuration <= 0)
            {
                isTeleporting = false;
                isInvincible = false;
                //ANIMATION STUFF~~~~~~~~~~~~~~~~~
                //stop current animation, start transform back to human animation

                //not needed below
                //isTeleporting set to false at start of transforming into malady animation
                //invincible set false at end of anim
            }

        }

        else if (!animating)
        {
            Act(classification);
        }

        if (refreshPriority >= 10)
        {
            sortPriority();
            refreshPriority = 0;
        }

        if (isInvincible && invTime <= 0)
        {
            isInvincible = false;
        }

        refreshPriority += Time.unscaledDeltaTime;
        hands_CD += Time.unscaledDeltaTime;
        animationDelay += Time.unscaledDeltaTime;
        invTime -= Time.unscaledDeltaTime;
        lerpDuration -= Time.unscaledDeltaTime;
    }
开发者ID:DevelopersGuild,项目名称:Castle-Bashers,代码行数:92,代码来源:Malady.cs


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