private void Start()
    {
        // Cursor should not be showed in plane scenes.
        Cursor.visible = false;

        // Getting AudioSource component of Plane object
        _audio = GetComponent <AudioSource>();

        // Getting Trail Renderer Component of TrailLeft gameobject.
        _trailLeft = transform.Find("TrailLeft").GetComponent <TrailRenderer>();

        // Getting Trail Renderer Component of TrailRight gameobject.
        _trailRight = transform.Find("TrailRight").GetComponent <TrailRenderer>();

        // Getting StartLevelHUD component of HUDController.
        _hud = GameObject.Find("HUDController").GetComponent <LevelHUD>();

        // Creating color from plane material.
        Color planeMatColor = _planeMaterial.color;

        // Setting left trail start color from plane material.
        _trailLeft.startColor = planeMatColor;

        // Setting left trail end color from plane material.
        _trailLeft.endColor = planeMatColor;

        // Setting right trail start color from plane material.
        _trailRight.startColor = planeMatColor;

        // Setting right trail end color from plane material.
        _trailRight.endColor = planeMatColor;
    }
Beispiel #2
0
    public void Init()
    {
        // Default values
        levelEnemyTypes.Add(EnemyNames.GOBLIN);

        enemy    = (GameObject)Resources.Load("EnemyPrototype");
        platform = (GameObject)Resources.Load("Platform");

        tag = "LevelHandler";
        transform.position = new Vector3(Camera.main.transform.position.x + 2 * Camera.main.orthographicSize, Camera.main.transform.position.y - Camera.main.orthographicSize / 2);

        // Init the generator and HUD
        GameObject blockGeneratorObject = new GameObject();

        blockGenerator = blockGeneratorObject.AddComponent <BlockGenerator>();
        blockGenerator.Init();
        blockGeneratorObject.transform.position = new Vector3(Camera.main.transform.position.x - Camera.main.orthographicSize, Camera.main.transform.position.y - Camera.main.orthographicSize);
        blockGenerator.SetLevelGenerator(this);

        GameObject levelHUDObject = new GameObject();

        levelHUD = levelHUDObject.AddComponent <LevelHUD>();
        levelHUD.SetLevelGenerator(this);

        manaRegenTimer = maxManaRegenTimer;

        // Testing
        pSpawnTimer = Random.Range(1f, 3f); // Spawn Platforms

        StandardLevel.speedModifier = StandardLevel.originalSpeedModifier;

        SwapPlayers(0);
    }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     Instance        = this;
     scoreBoard.text = "Score: 0";
     score           = 0;
     UpdateHighestScore();
 }
    void Awake()
    {
        Main.Instance.level = this;
        Init();

        //Initialize level UI after level conltroller has initialized.
        LevelHUD view = FindObjectOfType <LevelHUD>();

        view.Init(_model);

        SpawnHero(false);
    }
Beispiel #5
0
 void Start()
 {
     mAudioManager = FindObjectOfType(typeof(AudioManager)) as AudioManager;
     mLevelHUD     = FindObjectOfType(typeof(LevelHUD)) as LevelHUD;
     if (mAudioManager)
     {
         int index = 0;
         foreach (AudioClip clip in mAudioClips)
         {
             string title = mTextBoxId;
             title = title + index;
             mAudioManager.AddAudioClip(title, clip);
             index++;
         }
     }
     mIndex = 0;
     Assets.CustomeScripts.InformationManager.SetCurrentLevel(Application.loadedLevelName);
     Assets.CustomeScripts.InformationManager.AddTextBoxSummoner(mTextBoxId);
 }
Beispiel #6
0
    // Use this for initialization
    void Start()
    {
        //start the timer
        pauseStartTime = Time.time;

        //choose which hint to show
        if (hintList.Length > 0)
        {
            hintToShow = Mathf.RoundToInt(Random.Range(0, hintList.Length));
            Debug.Log(hintToShow);
        }

        //find the things you want to disable
        movementScript = GameObject.FindObjectOfType <PlayerMovement>();
        playerPause    = GameObject.FindObjectOfType <PauseButton>();
        theHUD         = GameObject.FindObjectOfType <LevelHUD>();

        //disable the things you want to disable
        movementScript.enabled = false;
        playerPause.enabled    = false;
        theHUD.enabled         = false;
    }