Inheritance: MonoBehaviour
Example #1
0
 // Use this for initialization
 void Start()
 {
     theLevelSelectManager = FindObjectOfType <LevelSelectManager> ();
     //loadCanvas = GameObject.Find("LoadCanvas");
     loadCanvas.SetActive(false);
     theLevelSelectManager.touchMode = true;
 }
Example #2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Example #3
0
 public void Start()
 {
     canvas             = GetComponentInChildren <Canvas> ();
     levelSelectManager = GetComponentInParent <LevelSelectManager> ();
     //little bit hacky but we're just gonna roll with it
     canvas.renderMode  = RenderMode.WorldSpace;
     canvas.worldCamera = worldCamera;
 }
 // Start is called before the first frame update
 void Start()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
     }
     instance = this;
 }
	// Use this for initialization
	void Start () {
		Instance = this;
		//Debug.Log (Network.isServer);
		//Debug.Log (NetworkServer.active);
		if (NetworkServer.active) {
			levelCanvas.Show ();
		}

	}
Example #6
0
    private void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
        }

        _instance = this;
        DontDestroyOnLoad(this.gameObject);
    }
    private void Awake()
    {
        if (Instance)
        {
            Destroy(gameObject);
        }

        Instance = this;
        SceneManager.activeSceneChanged += OnLevelFinishedLoading;
    }
Example #8
0
    private void InverseWorldButtonClicked()
    {
        LevelSelectManager levelSelectManager = GameObject.FindObjectOfType <LevelSelectManager>();

        if (levelSelectManager != null)
        {
            levelSelectManager.InverseWorld();
        }

        LevelManager.Instance.statsData.notif_chaos_shown = true;
        CloseWindow();
    }
Example #9
0
    // Use this for initialization
    void Start()
    {
        theLevelSelectManager = FindObjectOfType <LevelSelectManager> ();

                #if UNITY_ANDROID || UNITY_IOS
        theLevelSelectManager.touchMode = true;
        gameObject.SetActive(true);
                #else
        theLevelSelectManager.touchMode = false;
        gameObject.SetActive(false);
                #endif
    }
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Debug.LogError("Found another LevelSelectManager in the same Scene, make sure only 1 LevelSelectManager exist per scene");
         Destroy(gameObject); // Destroy myself is Instance already has a ref
     }
 }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        LevelSelectManager myScript = (LevelSelectManager)target;

        if (GUILayout.Button("Start Game"))
        {
            GameManager.Instance.DebugScene = true;
            GameManager.Instance.StartGame(myScript.LeadingLevels());
        }
    }
	// Use this for initialization
	void Start () 
	{
		TextAsset XMLTextAsset = (TextAsset) Resources.Load(LevelXMLPath);
		levelXmlDoc = new XmlDocument ();
		levelXmlDoc.LoadXml(XMLTextAsset.text);	
		
		levelScrollList = GetComponent<UIScrollList>();
		
		levelManager = transform.parent.GetComponentInChildren<LevelSelectManager>();
		
		//Populate the level list with levels.
		PopulateLevels();
	}
Example #13
0
    void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
        }

        else

        {
            instance = this;
        }
    }
Example #14
0
    public void ReadSaveData()
    {
        try
        {
            if (File.Exists(Application.persistentDataPath + "/" + savePath))
            {
                //Debug.Log("Reading From: " + Application.persistentDataPath + "/" + savePath);
                StreamReader reader       = new StreamReader(Application.persistentDataPath + "/" + savePath);
                int          currentIndex = 0;

                while (!reader.EndOfStream)
                {
                    string inp_ln = reader.ReadLine(); //Read In Save Data
                    if (inp_ln == "True")
                    {
                        //Debug.Log("Level "+currentIndex+" is Unlocked");
                        levelsUnlockStatus[currentIndex] = true;
                    }
                    else if (inp_ln == "False")
                    {
                        levelsUnlockStatus[currentIndex] = false;
                    }
                    else if (inp_ln != "")
                    {
                        crawlHighScore = int.Parse(inp_ln);
                    }
                    //Debug.Log("Data (" + currentIndex + "): " + inp_ln);
                    currentIndex++;
                }
                reader.Close();

                LevelSelectManager levelSelectManager = GameObject.FindObjectOfType <LevelSelectManager>();
                if (levelSelectManager)
                {
                    levelSelectManager.UpdateLevels(levelsUnlockStatus);
                }
            }
            else
            {
                System.IO.File.WriteAllText(Application.persistentDataPath + "/" + savePath, ""); //createfile
                WriteDefaultSaveValues();
                ReadSaveData();
            }
        }
        catch (Exception e)
        {
            Debug.Log(e);
        }
    }
    void Awake()
    {
        DontDestroyOnLoad(this);
        isShown = true;

        canvas             = GetComponentInChildren <CanvasGroup> ();
        levelSelectManager = GetComponent <LevelSelectManager> ();
        worldInfo          = GetComponentInChildren <WorldInfo> ();
        rectTransform      = worldInfo.GetComponent <RectTransform> ();

        worldGap = Screen.height * 3;
        background.rectTransform.sizeDelta = new Vector2(background.rectTransform.sizeDelta.x, worldGap * 6);
        rectTransform.offsetMax            = new Vector2(rectTransform.offsetMax.x, worldGap);
        rectTransform.offsetMin            = new Vector2(rectTransform.offsetMin.x, worldGap);
    }
Example #16
0
    // Start is called before the first frame update
    void Start()
    {
        rect = GetComponent <RectTransform>();
        // initialize moveTween to some value
        moveTween = rect.DOScale(1f, 0.001f);

        mainMenu    = FindObjectOfType <MainMenuManager>();
        teamSelect  = FindObjectOfType <TeamSelectManager>();
        helpScreen  = FindObjectOfType <HelpScreenManager>();
        levelSelect = FindObjectOfType <LevelSelectManager>();

        mainMenu.SetAsActive(true);
        teamSelect.SetAsActive(false);
        helpScreen.SetAsActive(false);
        levelSelect.SetAsActive(false);
    }
Example #17
0
    public void BuyRecipe2Ing()
    {
        if (GameManager.Instance().champiBank >= price01)
        {
            CheckRecette2Ing();
            Debug.Log(numberRecetteKnowWith2Ingr);

            if (obtainLayout != null)
            {
                Destroy(obtainLayoutObject);
            }

            if (LevelSelectManager.Instance().TutoStateValorReturn() == 2)
            {
                LevelSelectManager.Instance().TutoShop();
            }

            if (numberRecetteKnowWith2Ingr < listOfRecipe.recette2Ingredient.Count)
            {
                int tempRandomValor = Random.Range(0, listOfRecipe.recette2Ingredient.Count);
                Debug.Log(tempRandomValor);

                if (!GameManager.Instance().recetteKnow.Contains(listOfRecipe.recette2Ingredient[tempRandomValor]))
                {
                    GameObject tempRecipe = Instantiate(prefabRecetteObject, obtainLayout.transform);
                    tempRecipe.GetComponent <AffichageRecetteScript>().Change(listOfRecipe.recette2Ingredient[tempRandomValor]);
                    obtainLayoutObject = tempRecipe;
                    GameManager.Instance().AddRecetteKnow(listOfRecipe.recette2Ingredient[tempRandomValor]);
                    GameManager.Instance().ChampiBank(-price01);
                    LevelSelectManager.Instance().ChangeChampiText();
                    shopAudio.Play();
                    GameManager.Instance().SaveGame();
                }
                else
                {
                    BuyRecipe2Ing();
                }
            }
            else
            {
                CheckIfAllBuyRecipe2();
            }
        }
    }
Example #18
0
    public override void Awake()
    {
        //set up singleton instance
        if (controller == null)
        {
            controller = this;
            DontDestroyOnLoad(this);
            base.Awake();

            levelSelectManager = mainMenuSystem.GetComponent <LevelSelectManager>();
            worldSelectManager = mainMenuSystem.GetComponent <WorldSelectManager>();

            OnLevelWasLoaded();
        }
        else if (controller != this)
        {
            Destroy(gameObject);
        }
    }
Example #19
0
    // Use this for initialization
    void Start()
    {
        _playerObject = GameObject.Find("Player");
        _player       = _playerObject.GetComponent <Player>();

        _levelObject = GameObject.Find("BackTiles");
        _levelLayout = _levelObject.GetComponent <LevelLayout>();

        _playerControlsObject = GameObject.Find("Buttons");
        _playerControls       = _playerControlsObject.GetComponent <PlayerControls>();

        _cancelObject = GameObject.Find("Cancel");
        _cancel       = _cancelObject.GetComponent <CancelCommand>();

        _levelSelectManagerObject = GameObject.Find("LevelSelectButtons");
        _levelSelectManager       = _levelSelectManagerObject.GetComponent <LevelSelectManager>();

        EndOfCompile();
    }
Example #20
0
    void Awake()
    {
        RefreshStarsAndCoins();

        if (GlobalVariables.backFromGameplay)
        {
            // Ako smo dosli iz gameplay scene pustamo loading depart animaciju
            if (GlobalVariables.playLoadingDepartAtTheBegining)
            {
                StartCoroutine("LoadingDepartCoroutine");
            }
        }

        // Ako je zvuk ukljucen pustamo menu muziku
        SoundManager.Instance.Play_MenuMusic();
        SoundManager.Instance.Stop_GameplayMusic();

        if (SoundManager.musicOn == 0)
        {
            soundOffImageHolder.SetActive(true);
        }

        levelSelectManager = this;
    }
Example #21
0
    // Start is called before the first frame update
    void Start()
    {
        lvlSlctMngr = FindObjectOfType <LevelSelectManager>();

        lvlSlctMngr.touchMode = true;
    }
Example #22
0
 private void WinUpdateLevelDatabase()
 {
     LevelSelectManager.LevelCompleted(StaticData.LevelInformation.levelId, levelDatabase);
 }
Example #23
0
 public void OnStartNewGame()
 {
     unitSaveManager.ResetUnitAndInventorySaveData();
     LevelSelectManager.StartNewGame(levelDatabase);
 }
Example #24
0
    void Start()
    {
        manager = GetComponent<UIManager> ();
        startMenu = GetComponent<StartMenuManager> ();
        worldSelect = GetComponent<WorldSelectManager>();
        levelSelect = GetComponent<LevelSelectManager>();
        inGameUI = GetComponent<InGameUIManager> ();
        pauseMenu = GetComponent<PauseMenuManager> ();
        levelFail = GetComponent<LevelFailManager> ();
        levelSuccess = GetComponent<LevelSuccessManager> ();
        creditMenu = GetComponent<CreditsMenuManager> ();

        SetUIState(UIState.StartMenu);
    }
Example #25
0
 public void SetManager(LevelSelectManager manager)
 {
     this.manager = manager;
 }
Example #26
0
 // Use this for initialization
 void Start()
 {
     lvlSelect = FindObjectOfType <LevelSelectManager> ();
 }
Example #27
0
 // Use this for initialization
 void Start()
 {
     levelSelectManager           = FindObjectOfType <LevelSelectManager> ();
     levelSelectManager.touchMode = true;
 }
Example #28
0
 public void LoadLevel()
 {
     LevelSelectManager.Instance().LoadLevel(lvlNumber);
 }
Example #29
0
 void Start()
 {
     GetComponentInChildren <Canvas> ().renderMode = RenderMode.WorldSpace;
     levelSelectManager = GetComponentInParent <LevelSelectManager> ();
 }
    // Start is called before the first frame update

    private void Awake()
    {
        main = this;
    }
Example #31
0
 void Awake()
 {
     _instance = this;
 }
 // Use this for initialization
 void Start()
 {
     instance = this;
 }
Example #33
0
 public void BuyMush(int mushAdd)
 {
     GameManager.Instance().ChampiBank(mushAdd);
     LevelSelectManager.Instance().ChangeChampiText();
     cashShopAudio.Play();
 }