Inheritance: MonoBehaviour
Ejemplo n.º 1
0
 void Start()
 {
     levelMaster           = GameObject.Find("LevelMaster").GetComponent <LevelMaster>();
     textToUpdate.color    = newColor;
     textToUpdate.font     = newFont;
     textToUpdate.fontSize = newFontSize;
 }
Ejemplo n.º 2
0
 void Start()
 {
     levelMaster = GameObject.Find("LevelMaster").GetComponent<LevelMaster>();
     textToUpdate.color = newColor;
     textToUpdate.font = newFont;
     textToUpdate.fontSize = newFontSize;
 }
Ejemplo n.º 3
0
 void Update()
 {
     if (LevelMaster.input.Continue())
     {
         LevelMaster.Restart();
         gameObject.SetActive(false);
     }
 }
Ejemplo n.º 4
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         LevelMaster.Restart();
         gameObject.SetActive(false);
     }
 }
Ejemplo n.º 5
0
    private void Update()
    {
        lm = GameObject.FindGameObjectWithTag("LM").GetComponent <LevelMaster>();


        if (pauseGame)
        {
            Time.timeScale = 0;
        }
    }
Ejemplo n.º 6
0
 void Awake()
 {
     if (init != null)
     {
         Destroy(this.gameObject);
         return;
     }
     init = this;
     GameObject.DontDestroyOnLoad(this.gameObject);
 }
Ejemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        lm = GameObject.FindGameObjectWithTag("LM").GetComponent <LevelMaster>();

        gm = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>();

        if (lm.GetReset())
        {
            transform.position = gm.lastCheckpointPos;
        }
    }
Ejemplo n.º 8
0
    private void Start()
    {
        game = GameObject.FindGameObjectWithTag("LM").GetComponent <LevelMaster>();



        // Initialise the reference to the script object, which is a
        // component of the pause menu panel game object
        pauseMenu = pauseMenuPanel.GetComponent <PauseMenuManager>();
        pauseMenu.Hide();
    }
Ejemplo n.º 9
0
 private void Singleton()
 {
     if (instance == null)      //Check if instance already exists
     {
         instance = this;       //if not, set instance to this
     }
     else if (instance != this) //If instance already exists and it's not this:
     {
         Debug.Log("not the instance " + name);
         Destroy(gameObject); //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
     }
 }
Ejemplo n.º 10
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(instance);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 11
0
    async private void Awake()
    {
        await BeforeSceneLoad.loadFinishTask;

        //实例化LevelMaster
        LevelMaster levelMaster = Jyx2ResourceHelper.CreatePrefabInstance(ConStr.LevelMaster).GetComponent <LevelMaster>();

        DontDestroyOnLoad(levelMaster);
        levelMaster.name = "LevelMaster";
        levelMaster.transform.SetParent(transform, false);
        levelMaster.RuntimeDataSimulate = m_RuntimeDataSimulate;
        levelMaster.MobileSimulate      = m_MobileSimulate;
    }
Ejemplo n.º 12
0
 public void Start()
 {
     LevelMaster.AddBlueDot();
     if (activators.Count > 0)
     {
         foreach (BlueDot activator in activators)
         {
             activator.activates.Add(this);
         }
         active = false;
     }
     GetComponent <Animation> ().enabled = active;
 }
Ejemplo n.º 13
0
    // Use this for initialization
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        game   = GameObject.FindGameObjectWithTag("LM").GetComponent <LevelMaster>();
        gm     = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>();


        chick = GameObject.FindGameObjectWithTag("Chick");

        transform.position        = nest1;
        player.transform.position = player1;
        chick.transform.position  = chick1;
    }
        public override void OnEnter()
        {
            foreach (GameObject obj in GameTurnManager.GetInstance().m_PlayerPawns)
            {
                PawnBehavior   bhv   = obj.GetComponent <PawnBehavior>();
                PawnStatistics stats = obj.GetComponent <PawnStatistics>();
                GameStateManager.GetInstance().GetCharacter(bhv.m_CharacterId).SaveFrom(stats);
            }

            GameSceneManager.GetInstance().Pop(true);

            LevelMaster.GetInstance().ComeBackFromBattle();
        }
Ejemplo n.º 15
0
    private void Start()
    {
        gm     = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>();
        player = GameObject.FindGameObjectWithTag("Player");
        chick  = GameObject.FindGameObjectWithTag("Chick");



        //game.menuChick = GameObject.FindGameObjectWithTag("menuChick").GetComponent<Image>();
        //game.menuWorm = GameObject.FindGameObjectWithTag("menuWorm").GetComponent<Image>();
        //game.menuReset = GameObject.FindGameObjectWithTag("menureset").GetComponent<Image>();



        boxes      = GameObject.FindGameObjectsWithTag("Box");
        logs       = GameObject.FindGameObjectsWithTag("Log");
        boxesStart = new Vector3[boxes.Length];
        logsStart  = new Vector3[logs.Length];

        for (int i = 0; i < logs.Length; i++)
        {
            logsStart[i] = logs[i].transform.position;
        }
        for (int i = 0; i < boxes.Length; i++)
        {
            boxesStart[i] = boxes[i].transform.position;
        }


        game = GameObject.FindGameObjectWithTag("LM").GetComponent <LevelMaster>();



        game.menuChickStar = GameObject.FindGameObjectWithTag("menuChickStar");
        game.menuWormStar  = GameObject.FindGameObjectWithTag("menuWormStar");
        game.menuResetStar = GameObject.FindGameObjectWithTag("menuResetStar");


        game.levelComplete    = false;
        game.collectibleFound = false;


        // Initialise the reference to the script object, which is a
        // component of the pause menu panel game object

        //levelComplete = levelCompletePanel.GetComponent<CompleteLevelManager>();

        pauseMenu = pauseMenuPanel.GetComponent <PauseMenuManager>();
        //pauseMenu.Hide();
    }
Ejemplo n.º 16
0
    // Use this for initialization
    void Awake()
    {
        smokeTrail.enableEmission = false;
        maxHealth    = health;
        forwardSpeed = Random.Range(speedRange.x, speedRange.y);
        //transform.position = new Vector3(transform.position.x, Random.Range (heightRange.x, heightRange.y), transform.position.z);

        levelMaster = (LevelMaster)GameObject.FindGameObjectWithTag("LevelMaster").GetComponent("LevelMaster");

        forwardSpeed *= levelMaster.difficultyMultiplier;
        health       *= levelMaster.difficultyMultiplier;
        maxHealth    *= levelMaster.difficultyMultiplier;
        Debug.Log("Parent Awake");
    }
Ejemplo n.º 17
0
    // Use this for initialization
    void Awake()
    {
        smokeTrail.enableEmission = false;
        maxHealth = health;
        forwardSpeed = Random.Range (speedRange.x, speedRange.y);
        //transform.position = new Vector3(transform.position.x, Random.Range (heightRange.x, heightRange.y), transform.position.z);

        levelMaster = (LevelMaster)GameObject.FindGameObjectWithTag ("LevelMaster").GetComponent ("LevelMaster");

        forwardSpeed *= levelMaster.difficultyMultiplier;
        health *= levelMaster.difficultyMultiplier;
        maxHealth *= levelMaster.difficultyMultiplier;
        Debug.Log ("Parent Awake");
    }
Ejemplo n.º 18
0
    //Before Start()
    //When script initial
    void Awake()
    {
        //connect to levelmaster
        levelMaster = LevelMaster.Instance;

        //set health and speed
        maxHealth    = health;
        forwardSpeed = Random.Range(speedRange.x, speedRange.y);

        //multiply the speed and health based on difficulty
        forwardSpeed *= levelMaster.difficultyMultiplier;
        health       *= levelMaster.difficultyMultiplier;
        maxHealth    *= levelMaster.difficultyMultiplier;
    }
Ejemplo n.º 19
0
    public void OnTriggerEnter2D(Collider2D collider)
    {
        if (active)
        {
            AudioManager.instance.PlayDotPickup();
            LevelMaster.CollectBlueDot(transform.position);
            foreach (BlueDot activated in activates)
            {
                // TODO(samkern): Delay this activation and play a sound.
                activated.Activate(this);
            }

            Destroy(this.gameObject);
        }
    }
Ejemplo n.º 20
0
        void OnTriggerEnter(Collider _col)
        {
            PlayerBehavior behavior = _col.GetComponent <PlayerBehavior>();

            if (behavior != null)
            {
                if (m_CanEnterInCombat)
                {
                    m_CanEnterInCombat = false;

                    m_Runner.SetCurrentState((int)EnemyState.DeathEffect, "collision with player");

                    LevelMaster.GetInstance().StartBattleTransition(m_CombatSettings);
                }
            }
        }
Ejemplo n.º 21
0
    private void Die()
    {
        AudioManager.PlayPlayerDeath();

        Time.timeScale      = 1.0f;
        Time.fixedDeltaTime = 0.02F * Time.timeScale;
        LevelMaster.Defeat();

        GameObject explosion = Instantiate(ParticleManager.playerExplosion);

        explosion.transform.position = transform.position;

        Camera.main.StartShake(.3f, .3f, 2f, true);
        //Camera.main.ZoomIn (10.0f, PlayerCamera.originalSize - 2.0f, transform.position);

        Destroy(this.gameObject);
    }
Ejemplo n.º 22
0
 void OnTriggerEnter(Collider other)
 {
     if (levelMaster == null)
     {
         levelMaster = LevelMaster.Instance;
     }
     //	Debug.Log("Trigger");
     if (other.gameObject.tag == "Ground Enemy" ||
         other.gameObject.tag == "Air Enemy")
     {
         //		Debug.Log("Boom");
         Destroy(other.gameObject);
         levelMaster.enemyCount--;
         levelMaster.livesCount--;
         levelMaster.UpdateGUI();
     }
 }
Ejemplo n.º 23
0
    public void N_Restart()
    {
        levelText.enabled = true;
        gameOverPanel.SetActive(false);
        victoryPanel.SetActive(false);

        if (victoryPanel.transform.Find("NameInput").gameObject.activeInHierarchy)
        {
            LevelMaster.SaveHighScoreName(0, scoreName);
            victoryPanel.transform.Find("NameInput").gameObject.SetActive(false);
        }

        timing         = true;
        timerMin       = 0.0f;
        timerSec       = 0.0f;
        timerText.text = "0:00:00";
    }
Ejemplo n.º 24
0
    void Update()
    {
        if (LevelMaster.input.MenuExit())
        {
            gameObject.SetActive(false);
        }

        else if (Input.GetKeyDown(KeyCode.Q))
        {
            Application.Quit();
        }

        else if (LevelMaster.input.Continue())
        {
            LevelMaster.Restart();
            Notifications.self.SendPauseNotification(false);
            gameObject.SetActive(false);
        }
    }
Ejemplo n.º 25
0
    // Use this for initialization
    void Start()
    {
        //anim = noteType.NoteAnimation;
        //gameObject.GetComponent<Animator>().runtimeAnimatorController = anim;

        Renderer render = gameObject.GetComponent <Renderer>();

        levelMaster           = GameObject.Find("LevelMaster").GetComponent <LevelMaster>();
        noteType              = levelMaster.DetermineType();
        endValue              = noteType.endValue;
        hitValue              = noteType.hitValue;
        material              = noteType.material;
        bad                   = noteType.bad;
        scoreSystem           = noteType.scoreSystem;
        render.material       = material;
        render.material.color = noteType.colour;

        levelMaster.RegisterNode(this);
    }
Ejemplo n.º 26
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            gameObject.SetActive(false);
        }

        else if (Input.GetKeyDown(KeyCode.Q))
        {
            Application.Quit();
        }

        else if (Input.GetKeyDown(KeyCode.Space))
        {
            LevelMaster.Restart();
            Notifications.self.SendPauseNotification(false);
            gameObject.SetActive(false);
        }
    }
Ejemplo n.º 27
0
 void OnTriggerExit(Collider other)
 {
     if (!enabled)
     {
         return;
     }
     if (exitLockDirection)
     {
         LevelMaster levelMaster = GameObject.FindObjectOfType <LevelMaster>();
         //开启方向锁
         levelMaster.m_IsLockingDirection = true;
     }
     if (m_UnlockTarget)
     {
         if (old_followTarget != null)
         {
             vcam.Follow = old_followTarget;
         }
     }
 }
Ejemplo n.º 28
0
 // Use this for initialization
 void Start()
 {
     levelMaster = GameObject.Find("LevelMaster").GetComponent<LevelMaster>();
     levelMasterObj = GameObject.Find("LevelMaster");
 }
Ejemplo n.º 29
0
    // Use this for initialization
    void Start()
    {
        //anim = noteType.NoteAnimation;
        //gameObject.GetComponent<Animator>().runtimeAnimatorController = anim;

        Renderer render = gameObject.GetComponent<Renderer>();
        levelMaster = GameObject.Find("LevelMaster").GetComponent<LevelMaster>();
        noteType = levelMaster.DetermineType();
        endValue = noteType.endValue;
        hitValue = noteType.hitValue;
        material = noteType.material;
        bad = noteType.bad;
        scoreSystem = noteType.scoreSystem;
        render.material = material;
        render.material.color = noteType.colour;

        levelMaster.RegisterNode(this);
    }
Ejemplo n.º 30
0
        public static void GameTown()
        {
            for (int i = 0; i < Time.Events.Count; i++)
            {
                if (Time.Events[i].name == "Bank Construction" && Time.Events[i].trigger && Time.Events[i].active)
                {
                    bank = true;
                }
            }
            Console.Clear();
            Utilities.ColourText(Colour.SPEAK, "You are in the town of Marburgh. It is a small town, but is clearly growing. Who knows what will be here in a month?\n\n");
            if (tutorial)
            {
                Console.WriteLine("[W]eapon shop            [A]rmor shop            [I]tem shop          [D]ungeon");
            }
            else
            {
                Console.WriteLine("[I]tem shop              [D]ungeon");
            }
            if (tutorial && bank)
            {
                Console.WriteLine("[T]avern                 [Y]our house            [B]ank               [?]Help          ");
            }
            else
            {
                Console.WriteLine("[T]avern                 [Y]our house            [?]Help    ");
            }
            Console.WriteLine("[C]haracter              [L]evel Master          [O]ther Places       [Q]uit                 ");
            Utilities.ColourText(Colour.SPEAK, "\n\nWhat would you like to do?\n\n");
            Utilities.EmbedColourText(Colour.TIME, Colour.TIME, Colour.TIME, Colour.TIME, "It is day ", $"{Time.day}", ", the ", $"{Time.weeks[Time.week]}", " week of ", $"{Time.months[Time.month]}", ", ", $"{Time.year}", "\n\n");
            string choice = Console.ReadKey(true).KeyChar.ToString().ToLower();

            if (choice == "w" && tutorial)
            {
                Shop.GameShop(Shop.WeaponShop, Create.p);
            }
            else if (choice == "a" && tutorial)
            {
                Shop.GameShop(Shop.ArmorShop, Create.p);
            }
            else if (choice == "d")
            {
                Explore.DungeonCheck(d, Create.p);
            }
            else if (choice == "i")
            {
                Shop.ItemShop(Create.p);
            }
            else if (choice == "?")
            {
                Utilities.Help();
            }
            else if (choice == "c")
            {
                Utilities.CharacterSheet(Create.p);
            }
            else if (choice == "l")
            {
                LevelMaster.VisitLevelMaster(Create.p);
            }
            else if (choice == "t")
            {
                Tavern.Inn(Create.p);
            }
            else if (choice == "y")
            {
                House.YourHouse(Create.p);
            }
            else if (choice == "b" && tutorial && bank)
            {
                Bank.GameBank(Create.p);
            }
            else if (choice == "q")
            {
                Utilities.Quit();
            }
            else if (choice == "x")
            {
                Create.p.xp   += 50;
                Create.p.gold += 900;
                BlackJack.PlayBlackJack();
            }
            else if (choice == "o")
            {
                OtherPlaces.Other(Create.p);
            }
            GameTown();
        }
Ejemplo n.º 31
0
 void Start()
 {
     LevelMaster.Start();
     audioSrc = GetComponent <AudioSource>();
     reloadingUI.SetActive(false);
 }
Ejemplo n.º 32
0
 private void Awake()
 {
     lm   = GameObject.FindGameObjectWithTag("Levelman").GetComponent <LevelMaster>();
     move = GetComponent <GhostTrail>();
     sA   = GameObject.FindGameObjectWithTag("Special").GetComponent <SpecialAttack>().instance;
 }
Ejemplo n.º 33
0
 public static void Start()
 {
     prime        = new LevelMaster();
     prime.bossHB = GameObject.FindWithTag("HealthbarObject").GetComponent <BigRatHB>();
     prime.bossHB.gameObject.SetActive(false);
 }
Ejemplo n.º 34
0
        public static void GameTown()
        {
            for (int i = 0; i < Time.Events.Count; i++)
            {
                if (Time.Events[i].name == "Bank Construction" && Time.Events[i].trigger && Time.Events[i].active)
                {
                    bank = true;
                }
            }
            Console.Clear();
            UI.Town(new string[] { "You are in the town of Marburgh", "It is a small town, but is clearly growing", "Who knows what will be here in a month?" }, adventureList, shopList, serviceList, otherList, adventureButton, shopButton, serviceButton, otherButton);
            string choice = Console.ReadKey(true).KeyChar.ToString().ToLower();

            if (choice == "w" && tutorial)
            {
                Shop.GameShop(Shop.WeaponShop, Create.p);
            }
            else if (choice == "a" && tutorial)
            {
                Shop.GameShop(Shop.ArmorShop, Create.p);
            }
            else if (choice == "d")
            {
                Explore.DungeonCheck(d, Create.p);
            }
            else if (choice == "i")
            {
                Shop.ItemShop(Create.p);
            }
            else if (choice == "?")
            {
                Help.General();
            }
            else if (choice == "c")
            {
                Utilities.CharacterSheet(Create.p);
            }
            else if (choice == "l")
            {
                LevelMaster.VisitLevelMaster(Create.p);
            }
            else if (choice == "t")
            {
                Tavern.Inn(Create.p);
            }
            else if (choice == "y")
            {
                House.YourHouse(Create.p);
            }
            else if (choice == "b" && tutorial && bank)
            {
                Bank.GameBank(Create.p);
            }
            else if (choice == "q")
            {
                Utilities.Quit();
            }
            else if (choice == "x")
            {
                Create.p.xp   += 30;
                Create.p.gold += 500;
                tutorial       = true;
                Shop.itemShopOptionButton1.Add(Colour.ENHANCEMENT + "E" + Colour.RESET);
                Shop.itemShopOptionList1.Add("nhancement Machine");
            }
            else if (choice == "o")
            {
                OtherPlaces.Other(Create.p);
            }
            GameTown();
        }
Ejemplo n.º 35
0
    void Start()
    {
        levelMaster = GameObject.Find("LevelMaster").GetComponent<LevelMaster>();

        StartCoroutine(startSpawn());
    }