Ejemplo n.º 1
0
    public void StorePiece(GameMasterScript master, GameObject pieceToStore)
    {
        Debug.Log("Apagando um :" + pieceToStore.name);

        if (storedPiece == null)
        {
            storedPiece = FindPieceOnList(pieceToStore);
            pieceToStore.GetComponent <ShapeControler>().RemoveAllSquaresAndDie();
        }
        else
        {
            GameObject go;

            go          = storedPiece;
            storedPiece = FindPieceOnList(pieceToStore);
            pieceToStore.GetComponent <ShapeControler>().RemoveAllSquaresAndDie();
            master.activeShape = Spawn(go).GetComponent <ShapeControler>();

            Debug.Log("Devolvendo um :" + go.name);
        }

        Debug.Log("No Store: " + storedPiece.GetComponent <ShapeControler>().type.ToString());

        imageStored.sprite = SEU.spritesDictionary[storedPiece.GetComponent <ShapeControler>().type];
    }
Ejemplo n.º 2
0
    public void SubtractScore()
    {
        //locates objects from gamemaster script
        GameObject       Apple3     = GameObject.Find("GameMaster");
        GameMasterScript GameMaster = Apple3.GetComponent <GameMasterScript> ();


        //if there is 3 lives make it 2
        if (GameMaster.TillDeath == 3)
        {
            GameMaster.TillDeath--;
            GameMaster.Apple3.SetActive(false);
        }
        //if there are 2 lives make it 1
        else if (GameMaster.TillDeath == 2)
        {
            GameMaster.TillDeath--;
            GameMaster.Apple2.SetActive(false);
        }
        else
        {
            //if there are 1 lives make it 0
            GameMaster.TillDeath--;
            GameMaster.Apple1.SetActive(false);
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        theGameMaster  = GameObject.Find("GameMaster").GetComponent <GameMasterScript>();
        theChangeScene = GameObject.Find("Canvas").GetComponent <ChangeSceneScript>();

        //assign a sprite to the objects that will appear
        GameObject.Find("Object1").GetComponent <SpriteRenderer>().sprite = spritetobebought[0];
        GameObject.Find("Object2").GetComponent <SpriteRenderer>().sprite = spritetobebought[1];
        if (spritetobebought.Length >= 3)
        {
            GameObject.Find("Object3").GetComponent <SpriteRenderer>().sprite = spritetobebought[2];
        }

        GameObject.Find("ChooseButton").GetComponentInChildren <Text>().text = theGameMaster.languagehandler["Choose"];

        //initialise laguage and character elements
        GameObject.Find("ContinueButton").GetComponentInChildren <Text>().text = theGameMaster.languagehandler["Continue"];
        GameObject.Find("Congratulations").GetComponent <Text>().text          = theGameMaster.languagehandler["Congratulations"];
        //Debug.Log("option character" + theGameMaster.option_character);
        GameObject.Find("CharacterImage").GetComponent <Image>().sprite = theGameMaster.spriteslayers[theGameMaster.option_character];

        //hide all of these until we press coninue
        foreach (GameObject sgameObject in screenGameObjects)
        {
            sgameObject.SetActive(false);
        }
    }
Ejemplo n.º 4
0
    private void Awake()
    {
        thisTrans          = transform;
        gameMaster         = GameMasterScript.gameMaster;
        pauseMenuContainer = thisTrans.GetChild(0);
        pauseMenuContainer.gameObject.SetActive(true);
        characterPanelContainer = pauseMenuContainer.Find("Characters");
        characterPanels         = new BasicCharacterPanel[4];
        for (int i = 0; i < 4; i++)
        {
            characterPanels[i].panel        = characterPanelContainer.GetChild(i);
            characterPanels[i].portrait     = characterPanels[i].panel.GetChild(0).GetComponent <Image>();
            characterPanels[i].charName     = characterPanels[i].panel.GetChild(1).GetComponent <TextMeshProUGUI>();
            characterPanels[i].charType     = characterPanels[i].panel.GetChild(2).GetComponent <TextMeshProUGUI>();
            characterPanels[i].charHp       = characterPanels[i].panel.GetChild(3).GetComponent <TextMeshProUGUI>();
            characterPanels[i].charMp       = characterPanels[i].panel.GetChild(4).GetComponent <TextMeshProUGUI>();
            characterPanels[i].charLvl      = characterPanels[i].panel.GetChild(5).GetComponent <TextMeshProUGUI>();
            characterPanels[i].charToNext   = characterPanels[i].panel.GetChild(6).GetComponent <TextMeshProUGUI>();
            characterPanels[i].charTotalExp = characterPanels[i].panel.GetChild(7).GetComponent <TextMeshProUGUI>();
            characterPanels[i].charStatus   = characterPanels[i].panel.GetChild(8).GetComponent <TextMeshProUGUI>();
        }

        pauseMenuImages = transform.GetChild(0).GetComponentsInChildren <Image>();
        pauseMenuText   = transform.GetChild(0).GetComponentsInChildren <TextMeshProUGUI>();
        StorePauseScreenAlphas();
        HidePauseMenu();
    }
    // Start is called before the first frame update
    void Start()
    {
        recipenote = GetComponent <Text>();

        furnscript    = GameObject.Find("Furnace").GetComponent <FurnaceScript>();
        theGameMaster = GameObject.Find("GameMaster").GetComponent <GameMasterScript>();

        theNextRecipe = GameObject.Find("NextRecipeButton").GetComponent <NextRecipeScript>();

        speechbubble = GameObject.Find("SpeechBubble").GetComponent <SpriteRenderer>();

        firework     = Instantiate(firework);
        fireworkplay = firework.GetComponent <ParticleSystem>();

        if (GameObject.Find("IngredientsText") != null)
        {
            GameObject.Find("IngredientsText").GetComponent <Text>().text = theGameMaster.languagehandler["Ingredients"];
        }

        //assign smaller fontsize
        foreach (Image imagei in gameObject.GetComponent <RecipeCheckScript>().images)
        {
            imagei.GetComponentInChildren <Text>().fontSize = 20;
        }
    }
Ejemplo n.º 6
0
    // Start is called before the first frame update
    void Start()
    {
        theFurnace = GameObject.Find("Furnace").GetComponent <FurnaceScript>();

        //start by assigning spawning ingredients 'mostly' relevant to our current recipe
        if (theFurnace.recipe != null)
        {
            spawningredientsfromrecipe(ingredients);
        }
        else
        {
            foreach (GameObject ingr in ingredients)
            {
                ingredients_current.Add(ingr);
            }
        }

        //spawnallowed = false;//
        if (spawnallowed == true)
        {
            InvokeRepeating("SpawnIngredient", 0, 1 * gamespeed);
        }

        theGameMaster = GameObject.Find("GameMaster").GetComponent <GameMasterScript>();
    }
Ejemplo n.º 7
0
 private void OnDestroy()
 {
     if (_instance == this)
     {
         _instance = null;
     }
 }
 /// <summary>
 /// Get a reference to the required components
 /// </summary>
 void Start()
 {
     myRB      = GetComponent <Rigidbody2D>();
     myAnim    = GetComponent <Animator>();
     faceRight = true;
     gm        = GameObject.FindGameObjectWithTag("GameMaster").GetComponent <GameMasterScript> ();
 }
Ejemplo n.º 9
0
    // Use this for initialization
    void Start()
    {
        //arbitrary points for AI, higher means a better spot.
        boardPoints = new int[, ] {
            { 5, 1, 4, 4, 4, 4, 1, 5 },
            { 1, 1, 2, 2, 2, 2, 1, 1 },
            { 4, 2, 3, 3, 3, 3, 2, 4 },
            { 4, 2, 3, 3, 3, 3, 2, 4 },
            { 4, 2, 3, 3, 3, 3, 2, 4 },
            { 4, 2, 3, 3, 3, 3, 2, 4 },
            { 1, 1, 2, 2, 2, 2, 1, 1 },
            { 5, 1, 4, 4, 4, 4, 1, 5 }
        };

        gmScript = GetComponent <GameMasterScript>();
        //Save for later

        /*
         * for (int j = 0; j < BOARD_SIZE; j++) {
         *      for (int i = 0; i < BOARD_SIZE; i++) {
         *              if (isValidMove(i, j)) {
         *                      Instantiate(blackPiece, new Vector3(i, 1, j), Quaternion.identity);
         *              }
         *      }
         * }*/
    }
Ejemplo n.º 10
0
    };                                           //Listの横列の番号-2を指定
                                                 // Use this for initialization

    void Awake()
    {
        status     = gameObject.GetComponent <EnemyStatus>();
        gameMaster = FindObjectOfType <GameMasterScript>();
        aReader    = FindObjectOfType <AbilityReader>();
        Lv         = gameMaster.GetEnemyLV();
    }
Ejemplo n.º 11
0
    void Start()
    {
        boxCollider2D = GetComponent <BoxCollider2D>();

        //furnace needs this as a reference
        theFurnace = GameObject.Find("Furnace").GetComponent <FurnaceScript>();
        //also spawning
        theSpawning = GameObject.Find("SpawningPoint").GetComponent <SpawningScript>();

        //the ingredients should fly towards this, if correct
        target = null;

        theChangeScene = GameObject.Find("Canvas").GetComponent <ChangeSceneScript>();

        theMoney = GameObject.Find("Money").GetComponent <MoneyScript>();

        theSPF = GameObject.Find("SpawningFoodLayer").GetComponent <SpawningFoodLayerScript>();
        theSPF.spawnfoodlayer();//

        foodlayerclone = GameObject.Find("FoodLayer(Clone)");

        theNextRecipe = GameObject.Find("NextRecipeButton").GetComponent <NextRecipeScript>();

        theGameMaster = GameObject.Find("GameMaster").GetComponent <GameMasterScript>();
    }
Ejemplo n.º 12
0
 void Start()
 {
     if (gm == null)
     {
         gm = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMasterScript>();
     }
 }
Ejemplo n.º 13
0
    private void Awake()
    {
        thisTrans        = transform;
        gameMaster       = GameMasterScript.gameMaster;
        rpgMenuContainer = thisTrans.GetChild(0);
        rpgMenuContainer.gameObject.SetActive(true);
        playerStatsContainer = rpgMenuContainer.GetChild(1).Find("PlayerStats");
        playerStatPanels     = new PlayerStatPanel[4];
        for (int i = 0; i < 4; i++)
        {
            playerStatPanels[i].panel    = playerStatsContainer.GetChild(i);
            playerStatPanels[i].charName = playerStatPanels[i].panel.GetChild(0).GetComponent <TextMeshProUGUI>();
            playerStatPanels[i].charHp   = playerStatPanels[i].panel.GetChild(1).GetComponent <TextMeshProUGUI>();
            playerStatPanels[i].charMp   = playerStatPanels[i].panel.GetChild(2).GetComponent <TextMeshProUGUI>();
        }
        enemyStatsContainer = rpgMenuContainer.GetChild(1).Find("EnemyStats");
        enemyStatPanels     = new EnemyStatPanel[4];
        for (int i = 0; i < 4; i++)
        {
            enemyStatPanels[i].panel     = enemyStatsContainer.GetChild(i);
            enemyStatPanels[i].enemyName = enemyStatPanels[i].panel.GetChild(0).GetComponent <TextMeshProUGUI>();
            enemyStatPanels[i].enemyHp   = enemyStatPanels[i].panel.GetChild(2);
            enemyStatPanels[i].enemyLvl  = enemyStatPanels[i].panel.GetChild(3).GetComponent <TextMeshProUGUI>();
        }

        rpgMenuImages = rpgMenuContainer.GetComponentsInChildren <Image>();
        rpgMenuText   = rpgMenuContainer.GetComponentsInChildren <TextMeshProUGUI>();
        StoreMenuAlphas();
        HidePauseMenu();
    }
Ejemplo n.º 14
0
    void Start()
    {
        gameMaster = FindObjectOfType <GameMasterScript>();
        //今回のえねみーを指定
        enemyTag     = gameMaster.GetTag();
        enemyLV      = gameMaster.GetLV();
        createAmount = gameMaster.GetKillAmount();

        switch (enemyTag)
        {
        case WARG:
            enemyPrefab      = enemyPref[0];
            unremoveEnemyNum = 0;
            break;

        case DRAGON:
            enemyPrefab      = enemyPref[1];
            unremoveEnemyNum = 1;
            break;

        case CYCLOPS:
            enemyPrefab      = enemyPref[2];
            unremoveEnemyNum = 2;
            break;

        case GOLEM:
            enemyPrefab      = enemyPref[3];
            unremoveEnemyNum = 3;
            break;

        case SKYDRAGON:
            enemyPrefab      = enemyPref[4];
            unremoveEnemyNum = 4;
            break;

        case SKELTON:
            enemyPrefab      = enemyPref[5];
            unremoveEnemyNum = 5;
            break;

        case ROBOT:
            enemyPrefab      = enemyPref[6];
            unremoveEnemyNum = 6;
            break;

        case TROLL:
            enemyPrefab      = enemyPref[7];
            unremoveEnemyNum = 7;
            break;
        }

        // 配列確保
        existEnemys = new GameObject[maxEnemy];
        // 周期的に実行したい場合はコルーチンを使うと簡単に実装できます。
        StartCoroutine(Exec());
        //いらない奴らは消す
        // RemovePref();
    }
Ejemplo n.º 15
0
    private void Start()
    {
        myRB2D       = GetComponent <Rigidbody2D>();
        theGM        = GameMasterScript._instance;
        player1Trans = GameObject.FindGameObjectWithTag("Player 1").transform;
        player2Trans = GameObject.FindGameObjectWithTag("Player 2").transform;

        list.AddRange(array);
    }
Ejemplo n.º 16
0
 private void Start()
 {
     gm                 = GameObject.Find("GameMaster").GetComponent <GameMasterScript>();
     menuPanel          = GameObject.Find("MenuPanel");
     uiPanel            = GameObject.Find("uiPanel");
     difficultyDropdown = GameObject.Find("DifficultyDropdown").GetComponent <Dropdown>();
     playerLetterText   = GameObject.Find("PlayerLetterText");
     uiPanel.SetActive(false);
 }
Ejemplo n.º 17
0
    public void DamagePlayer(int damage)
    {
        playerStats.currentHealth -= damage;
        if (playerStats.currentHealth <= 0)
        {
            GameMasterScript.killPlayer(this);
        }

        statusIndicator.SetHealth(playerStats.maxHealth, playerStats.currentHealth);
    }
Ejemplo n.º 18
0
    public static Vector3 RandomCircle(Vector3 center, float radius)
    {
        float   ang = GameMasterScript.Random(0f, 1f) * 360;
        Vector3 pos;

        pos.x = center.x + radius * Mathf.Sin(ang * Mathf.Deg2Rad);
        pos.y = center.y + radius * Mathf.Cos(ang * Mathf.Deg2Rad);
        pos.z = center.z;
        return(pos);
    }
Ejemplo n.º 19
0
    public static Vector3 RandomCircle()
    {
        float   ang = GameMasterScript.Random(0f, 1f) * 360;
        Vector3 pos;

        pos.x = Mathf.Sin(ang * Mathf.Deg2Rad);
        pos.y = Mathf.Cos(ang * Mathf.Deg2Rad);
        pos.z = 0;
        return(pos);
    }
 void Start()
 {
     PlayerTrans           = GameObject.Find("Player").GetComponent <Transform>();
     experience            = GameObject.Find("Player").GetComponent <ExperienceScript>();
     anim                  = GetComponent <Animation>();
     healthSlider          = GetComponentInChildren <Slider>();
     healthSlider.maxValue = enemyHealth;
     healthSlider.value    = enemyHealth;
     PlayerScript          = GameObject.Find("Player").GetComponent <PlayerScript>();
     Attack                = GameObject.Find("GM").GetComponent <GameMasterScript>();
 }
Ejemplo n.º 21
0
    //private bool canResetGame = false;

    private void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
        }
        else
        {
            Destroy(this);
        }
    }
Ejemplo n.º 22
0
 void Start()
 {
     cameraShake = Camera.main.GetComponent <CameraShakeController>();
     GameMaster  = GameObject.Find("Game Master").GetComponent <GameMasterScript>(); // CHANGE GAMEOBJ.FIND
     playerAnimator.GetComponent <SpriteRenderer>().color = color;
     littleArrow.color = color;
     fireScript        = GetComponentInChildren <Fire>();
     rigidBody         = GetComponent <Rigidbody2D>();
     speed             = StandardSpeed;
     isPoweredUp       = false;
 }
Ejemplo n.º 23
0
 void OnTriggerStay(Collider other)
 {
     if (other.gameObject.tag == "Apple")
     {
         //locates gamemaster script and score
         GameObject       Score      = GameObject.Find("GameMaster");
         GameMasterScript GameMaster = Score.GetComponent <GameMasterScript> ();
         //puts the score into the text of the gameobject
         ScorePopUpText(GameMaster.GameScore.ToString());
     }
 }
Ejemplo n.º 24
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(instance);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 25
0
 // Start is called before the first frame update
 void Start()
 {
     gameMaster         = GameMasterScript.gameMaster;
     shmupManager       = ShmupManager.shmupManager;
     gameMaster.loading = false; //VERY TEMPORARY
     input = GameMasterScript.inputScript;
     SpawnEnemies(gameMaster.enemyPartySpawns);
     DetectCharacters();
     battleUI.CharacterCursors(charSelectIndex, charsSelected);
     CalculateTurnValue();
     TurnChange();
 }
Ejemplo n.º 26
0
    // Start is called before the first frame update
    void Start()
    {
        game_master_script = GameObject.Find("GameMaster").GetComponent <GameMasterScript>();

        achievement_script = achievement.GetComponent <AchievementSystem>();
        CheckSteps();

        fade_obj    = game_master_script.fade_obj;
        fade_script = fade_obj.GetComponent <Fade>();
        fade_obj.SetActive(false);
        quit_to_menu = false;
    }
Ejemplo n.º 27
0
 void Start()
 {
     anim        = GetComponent <Animation>();
     rb          = GetComponent <Rigidbody>();
     health      = GetComponent <HealthScript>();
     mana        = GetComponent <HealthScript>();
     warningText = GameObject.Find("WarningText").GetComponent <Text>();
     audioS      = GetComponent <AudioSource>();
     respawnBtn  = GameObject.Find("RespawnBTN").GetComponent <Button>();
     respawnBtn.gameObject.SetActive(false);
     PlayerLevel = GetComponent <ExperienceScript>();
     attack      = GameObject.Find("GM").GetComponent <GameMasterScript>();
 }
Ejemplo n.º 28
0
    private void Awake()
    {
        thisTrans   = transform;
        gameMaster  = GameMasterScript.gameMaster;
        shmupMaster = ShmupManager.shmupManager;

        if (regularKillzone)
        {
            DetectKillzone();
        }

        enemyBulletKillzoneLayer = LayerMask.NameToLayer("EnemyBulletKillZone");
    }
Ejemplo n.º 29
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
Ejemplo n.º 30
0
    public void DamageEnemy(int damage)
    {
        enemyStats.currentHealth -= damage;
        if (enemyStats.currentHealth <= 0)
        {
            GameMasterScript.killEnemy(this);
        }

        if (statusIndicator != null)
        {
            statusIndicator.SetHealth(enemyStats.maxHealth, enemyStats.currentHealth);
        }
    }
Ejemplo n.º 31
0
	// Use this for initialization
	void Awake () {

        if (!masterScript)
        {
            masterScript = this;
            //InitializeLevelData();
            //InitializeSOLevelData();
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
    
	}
Ejemplo n.º 32
0
    void Start()
    {
        rb2d = gameObject.GetComponent<Rigidbody2D>();
        anim = gameObject.GetComponent<Animator>();

        gameMaster = GameObject.FindGameObjectWithTag("GameMaster").GetComponent<GameMasterScript>();
        canMove = true;
    }
Ejemplo n.º 33
0
 void Start()
 {
     gameMaster = GameObject.FindGameObjectWithTag ("GameMaster").GetComponent<GameMasterScript> ();
 }
Ejemplo n.º 34
0
 // Use this for initialization
 void Start()
 {
     currentHealth = maxHealth;
     gameMaster = GameObject.FindGameObjectWithTag ("GameMaster").GetComponent<GameMasterScript> ();
 }