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


C# LevelManager类代码示例

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


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

示例1: Start

    void Start()
    {
        audio_source = GetComponent<AudioSource> ();

                if (new_level) {
                        SelectMusic ();
                        new_level = false;
                }

                levelManager = GameObject.Find ("LevelLogic").GetComponent<LevelManager> ();
                enemyManager = GameObject.Find ("LevelLogic").GetComponent<EnemyManager> ();
                playerManager = GameObject.Find ("LevelLogic").GetComponent<PlayerManager> ();

                //Form level
                levelManager.InitLevelMap ();
                //Update Each Tile in map - includeds asigning values through CA

                levelManager.UpdateGapsAndPlatforms ();
                levelManager.UpdateLevelMap ();
                //Draw level
                levelMap = levelManager.GetLevelMap ();
                levelManager.DrawLevelMap ();

                //Get level map tile array
                //levelMap = levelManager.GetLevelMap ();

                enemyManager.LoadMap (levelMap);
                playerManager.LoadMap (levelMap);

                //Player must be loaded after level for raycasting to work
                playerManager.LoadPlayerSpawn ();
                playerManager.LoadEndPoint ();
                enemyManager.LoadEnemySpawns ();
    }
开发者ID:mduffyg13,项目名称:Honours-Project,代码行数:34,代码来源:LevelLogic.cs

示例2: Awake

    void Awake()
    {
        levelManager = LevelManager.levelManager;
        myTransform = transform;
        initialPosition = myTransform.localPosition;

        // Si on ne veut pas de la liste classique, on doit renseigner ceux que l'on veut ainsi que les poids associés
        if (specificPickup.Length > 0) {
            for (int i = 0; i < specificPickup.Length; i++) {
                // Si le pickup n'est pas activé, on passe au suivant
                if (!IsPickupActivated (specificPickup [i]))
                    continue;

                listeBonus.Add (specificPickup[i]);

                int currentWeight = 0;
                // Si l'on ne veut pas les poids standards, on doit les changer également (il doit aussi y en avoir 1 pour 1 pickup)
                if (specificPickup.Length == specificWeight.Length) {
                    currentWeight = specificWeight [i];
                } else {
                    currentWeight = specificPickup [i].weight;
                }
                weightBonus.Add (currentWeight);
            }
        } else {
            for (int i = 0; i < ListManager.current.powerups.Length; i++) {
                // Si le pickup n'est pas activé, on passe au suivant
                if (!IsPickupActivated (ListManager.current.powerups[i]))
                    continue;

                listeBonus.Add (ListManager.current.powerups[i]);
                weightBonus.Add (ListManager.current.powerups[i].weight);
            }
        }
    }
开发者ID:lpointet,项目名称:runblobby,代码行数:35,代码来源:PickupSpawn.cs

示例3: Start

	// Use this for initialization
	void Start () {
		Debug.Log("Player Spawned");
		SpawnPlayer();
		levelManager = FindObjectOfType<LevelManager>();
		lives = 3;
	
	}
开发者ID:ocoulson,项目名称:UnityTuts,代码行数:8,代码来源:PlayerSpawner.cs

示例4: Start

    // Use this for initialization
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        LM = (LevelManager)FindObjectOfType(typeof(LevelManager));

        Debug.Log("Starting #" + nHumans);
        myTransform = transform;
        spriteObj = GetComponent<exSprite>();
        spriteAnimation = GetComponent<exSpriteAnimation>();
        // Determine if I should be an alien.
        if (nAliens < maxAliens) {
            float pAlien = 0;
            if (nHumans >= nHandlers - maxAliens) {
                pAlien = 1;
            }
            else {
                pAlien = Random.Range(0, nHandlers);
            }
            if (pAlien <= 1 || nHumans >= nHandlers ) {
                Debug.Log("Human "+ nHumans + " Is an ALIEN!");
                isAlien = true;
                nAliens++;
                nHumans++;
            }
            else {
                Debug.Log("Human "+ nHumans + " Is a HUMAN!");
                nHumans++;
            }
        }
        //EventManager.instance.AddListener(this, "Oso_clicked");
        if (isAlien) {
            audio.pitch = 1.75f;
        }
    }
开发者ID:lucascaro,项目名称:InspectorHeartbeat,代码行数:35,代码来源:ClickHandler.cs

示例5: Start

    void Start()
    {
        Screen.showCursor = false;
        manager = (GameObject.Find("LevelManager").GetComponent("LevelManager")) as LevelManager;
        player_sound_manager = (GameObject.Find("MainPlayer").GetComponent("PlayerSoundManager")) as PlayerSoundManager;
        current_level = Application.loadedLevel;
        player = GameObject.Find("MainPlayer");
        player.transform.position = start_pos.transform.position;
        fade_in.FadeIn();
        player.tag = "Player";
        CharacterMotor motor = LevelManager.player.GetComponent("CharacterMotor") as CharacterMotor;
        if(current_level == 3 && !boosted)
        {
            boosted = true;
            motor.movement.maxForwardSpeed += 0.5f;
            motor.movement.maxBackwardsSpeed += 0.5f;
            motor.movement.maxSidewaysSpeed += 0.5f;
            motor.jumping.baseHeight += 0.02f;
            motor.jumping.extraHeight += 0.02f;

            default_speed = motor.movement.maxForwardSpeed;
            default_jump = motor.jumping.baseHeight;
        }
        else if(current_level == 3)
        {
            motor.movement.maxForwardSpeed = default_speed;
            motor.movement.maxBackwardsSpeed = default_speed;
            motor.movement.maxSidewaysSpeed = default_speed;
            motor.jumping.baseHeight = default_jump;
            motor.jumping.extraHeight = default_jump;
        }
    }
开发者ID:jackykschou,项目名称:ECHO_scripts,代码行数:32,代码来源:LevelManager.cs

示例6: Start

 // Use this for initialization
 void Start()
 {
     Config config = GetComponent<Config>();
     m_levelManager = GetComponent<LevelManager>();
     m_scoreTable = config.ScoreTable;
     m_scoreMultipliers = config.ScoreMultipliers;
 }
开发者ID:nigamshah,项目名称:spaceshooter,代码行数:8,代码来源:ScoreCalculator.cs

示例7: Start

 void Start()
 {
     leftmost = (Camera.main.ViewportToWorldPoint(new Vector2(0,0)) + new Vector3(this.GetComponent<SpriteRenderer>().sprite.bounds.size.x / 2 + buffer, 0, 0));
     rightmost = (Camera.main.ViewportToWorldPoint(new Vector2(1,0)) - new Vector3(this.GetComponent<SpriteRenderer>().sprite.bounds.size.x / 2 + buffer, 0, 0));
     hpBar = GameObject.Find("HealthBar").GetComponent<Image>();
     levelManager = GameObject.FindObjectOfType<LevelManager>();
 }
开发者ID:FlorinVasileNechita,项目名称:UnityCourseLaserDefender,代码行数:7,代码来源:PlayerController.cs

示例8: Start

	// Use this for initialization
	void Start ()
	{
		isBreakable = (this.tag == "Breakable"); 
		if (isBreakable)
			numberOfBricks++;
		levelManager = GameObject.FindObjectOfType<LevelManager> ();
	}
开发者ID:moisesejimenezg,项目名称:BlockBreaker,代码行数:8,代码来源:Brick.cs

示例9: Start

 void Start()
 {
     manager = GameObject.FindObjectOfType<LevelManager>();
     Vector3 scale = gameObject.transform.localScale;
     scale.x = 0;
     gameObject.transform.localScale = scale;
 }
开发者ID:ocoulson,项目名称:MScProjectUnity,代码行数:7,代码来源:LoadingBar.cs

示例10: Start

 void Start()
 {
     timer = GetComponent<Slider> ();
     levelManager = GameObject.FindObjectOfType<LevelManager> ();
     winLabel = GameObject.Find ("Survived");
     winLabel.SetActive (false);
 }
开发者ID:FlorinVasileNechita,项目名称:LaneDefender,代码行数:7,代码来源:GameTimer.cs

示例11: Start

    public void Start()
    {
        manager = GameObject.Find("Manager").GetComponent<LevelManager>();
        player = GameObject.Find("Player").GetComponent<Player>();

        initialPosition = new Vector3(7.5f,0.73f,-8.9f);

        player.SetPosition(initialPosition);
        player.SetRotation(new Quaternion(0f,0f,0f,0));

        gameOver = false;

        xLimit1 = -10.8f;
        xLimit2 = 8f;
        yLimit1 = 0.3f;
        yLimit2 = 4f;
        zLimit1 = -9.5f;
        zLimit2 = 9.5f;

        radiusFood = 0.5f;
        counter = 0f;
        previousCounter = 0f;

        foodObjects = new string[]{"FoodApple","FoodBanana","FoodCandyCane"};

        timerLimit = 2.0f;
        timer = timerLimit;

        player.SetActive(true);

        CreateFoodObjects(foodQty);
    }
开发者ID:ThaisCorreia,项目名称:Unity-Game_CollectFood,代码行数:32,代码来源:GameManager.cs

示例12: Start

 void Start()
 {
     levelManager = GameObject.FindObjectOfType<LevelManager>();
     ball = GameObject.FindObjectOfType<Ball>();
     textLife = GameObject.FindObjectOfType<Text>();
     paddle = GameObject.FindObjectOfType<Paddle>();
 }
开发者ID:Qhoros,项目名称:Unity,代码行数:7,代码来源:LoseCollider.cs

示例13: Start

    // Use this for initialization
    void Start()
    {
        //Filter load private resources
        levelmanager = GameObject.FindObjectOfType<LevelManager> ();

        timesHit = 0;
    }
开发者ID:onyxhat,项目名称:Unity_Course,代码行数:8,代码来源:Brick.cs

示例14: Start

 // Use this for initialization
 void Start()
 {
     text = GetComponent<Text> ();
     playerHealth = maxPlayerHealth;
     levelManager = FindObjectOfType<LevelManager> ();
     isDead = false;
 }
开发者ID:jkien,项目名称:PlatformerTutorial,代码行数:8,代码来源:HealthManager.cs

示例15: Start

 void Start()
 {
     levelManager = FindObjectOfType<LevelManager>();
     animator = GetComponentInChildren<Animator>();
     transform = gameObject.transform;
     speed = Random.Range(levelManager.Speed + 2, maxSpeed);
 }
开发者ID:urgamedev,项目名称:BrainCodeMobi,代码行数:7,代码来源:RocketController.cs


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