Пример #1
0
    public override void Awake()
    {
        base.Awake();

        stats.Add(new Dictionary <string, object>()
        {
            ["topSpeedNormal"]  = 6F,
            ["topSpeedSpeedUp"] = 12F,
            ["topSpeed"]        = (Func <string>)(() => HasEffect("speedUp") ? "topSpeedSpeedUp" : "topSpeedNormal"),
            ["terminalSpeed"]   = 16.5F
        });

        LevelManager.current.characters.Add(this);
        playerId = LevelManager.current.GetFreePlayerId();
        input    = new InputCustom(1);

        InitReferences();

        Level levelDefault = FindObjectOfType <Level>();

        if (currentLevel == null)
        {
            currentLevel         = levelDefault;
            respawnData.position = levelDefault.spawnPosition;
            Respawn();
        }

        if (GlobalOptions.GetBool("tinyMode"))
        {
            sizeScale = 0.5F;
        }
    }
Пример #2
0
    public void UpdateStartJoin()
    {
        for (int controllerId = 1; controllerId <= maxPlayers; controllerId++)
        {
            if (InputCustom.GetButtonDown(controllerId, "Pause"))
            {
                bool alreadySpawned = false;
                foreach (Character character in characters)
                {
                    if (character.input.controllerId == controllerId)
                    {
                        if (!debugMutliplayer)
                        {
                            alreadySpawned = true;
                            break;
                        }
                    }
                }
                if (alreadySpawned)
                {
                    continue;
                }

                Character characterNew = Instantiate(
                    Resources.Load <GameObject>("Character/Character"),
                    transform
                    ).GetComponent <Character>();
                Utils.SetScene(characterNew.transform, "Level");
                characterNew.input.controllerId = controllerId;
            }
        }
    }
Пример #3
0
    public void UpdateStartJoin()
    {
        for (var controllerId = 1; controllerId <= maxPlayers; controllerId++)
        {
            if (!InputCustom.GetButtonDown(controllerId, "Pause"))
            {
                continue;
            }
            var alreadySpawned = characters.Where(character => character.input.controllerId == controllerId).Any(character => !debugMutliplayer);
            if (alreadySpawned)
            {
                continue;
            }

            var characterNew = Instantiate(
                Resources.Load <GameObject>("Character/Character"),
                transform
                ).GetComponent <Character>();
            Utils.SetScene(characterNew.transform, "Level");
            characterNew.input.controllerId = controllerId;
        }
    }