Наследование: MonoBehaviour
    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>();
    }
Пример #2
0
 void Start()
 {
     rb           = this.GetComponent <Rigidbody2D>();
     player       = GameObject.FindWithTag("Player").transform;
     spawnsc      = GameObject.Find("Spawner").GetComponent <SpawningScript>();
     timeBtwShots = startTimeBtwShots;
     Invoke("dead", DeathTimer);
 }
    void Start()
    {
        rb = this.GetComponent <Rigidbody2D>();

        spawnsc = GameObject.Find("Spawner").GetComponent <SpawningScript>();
        //This finds the text for the score.
        score = GameObject.Find("scoretext").GetComponent <ScoreScript>();
        if (GameObject.Find("player") != null)
        {
            weapon = GameObject.Find("player").GetComponent <Weapons_Systems>();
        }
    }
Пример #4
0
    void Start()
    {
        rb = this.GetComponent <Rigidbody2D>();
        if (GameObject.FindWithTag("Player") != null)
        {
            player = GameObject.FindWithTag("Player").transform;
        }
        timeBtwShots = startTimeBtwShots;

        spawnsc = GameObject.Find("Spawner").GetComponent <SpawningScript>();
        score   = GameObject.Find("scoretext").GetComponent <ScoreScript>();
        weapon  = GameObject.Find("player").GetComponent <Weapons_Systems>();
    }
Пример #5
0
 public void AttachSpawner(SpawningScript spawner)
 {
     spawner_ = spawner;
 }