Beispiel #1
0
 void Awake()
 {
     player     = GameObject.FindGameObjectWithTag("Player");
     r          = player.GetComponent <References>();
     world      = GameObject.FindWithTag("World");
     canvas     = GameObject.FindGameObjectWithTag("Canvas");
     vitals     = player.GetComponent <Vitals>();
     spawnStuff = world.GetComponent <SpawnStuff>();
     inventory  = player.GetComponent <Inventory>();
 }
Beispiel #2
0
    //settings.onPause += Handler.Handle;

    // Use this for initialization
    void Start()
    {
        settings  = this;
        GameState = State.Play;
        Pc        = Player.GetComponent <PlayerController>();
        FinalPanel.SetActive(false);
        GSI        = Camera.main.GetComponent <GameSpeedIncreaser>();
        spawnStuff = Camera.main.GetComponent <SpawnStuff>();
        SceneManager.sceneLoaded += OnSceneLoaded;
        bubbleButt.Bubble         = this.Bubble;
        bubbleButt.BubblesSprites = this.BubblesSprites;
        bubbleButt.Speed          = this.Speed;
    }
    void Start()
    {
        percent = 0;
        speed   = 1 / SecondToCoef;
        if (DebugMode)
        {
            Debug.Log("Speed is " + speed);
        }
        spawnStuff = gameObject.GetComponent <SpawnStuff>();
        SomeStuff  = new List <Stuff>();
        int i;

        foreach (hasSpeed temp in PlayerNSlider)
        {
            SomeStuff.Add(new Stuff(temp));
        }
    }
Beispiel #4
0
    void Start()
    {
        player          = GameObject.FindGameObjectWithTag("Player");
        menu            = GameObject.FindGameObjectWithTag("Menu");
        inventory       = GameObject.FindGameObjectWithTag("Inventory");
        death           = GameObject.FindGameObjectWithTag("Death");
        craftingMenu    = GameObject.FindGameObjectWithTag("CraftingMenu");
        craftingSubmenu = GameObject.FindGameObjectWithTag("CraftingSubmenu");
        world           = GameObject.FindGameObjectWithTag("World");
        toolsManager    = GameObject.FindGameObjectWithTag("ToolsManager");


        //Scripts:
        spawnStuff         = world.GetComponent <SpawnStuff>();
        vitals             = player.GetComponent <Vitals>();
        toolsManagerScript = toolsManager.GetComponent <ToolsManagerScript>();
        inventoryScript    = player.GetComponent <Inventory>();
    }
Beispiel #5
0
    // Use this for initialization
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            gamecontrol = gameControllerObject.GetComponent <SpawnStuff> ();
        }
        else
        {
            Debug.Log("Cannot find 'SpawnStuff' script");
        }
        collectRB = GetComponent <Rigidbody>();
        color     = colors [Random.Range(0, colors.Length)];
        MeshRenderer rend = GetComponent <MeshRenderer> ();

        rend.material = color;
        MeshFilter filter = GetComponent <MeshFilter> ();

        shape       = shapes [Random.Range(0, shapes.Length)];
        filter.mesh = shape;
    }
Beispiel #6
0
 // Use this for initialization
 void Start()
 {
     spawner    = GameObject.Find("_GM").GetComponent <SpawnStuff>();
     scoreBoard = GameObject.Find("_GM").GetComponent <ScoreManager>();
     snake      = GameObject.Find("_GM").GetComponent <SnakeController>();
 }
Beispiel #7
0
 // Use this for initialization
 void Start()
 {
     gameControl       = GameObject.FindWithTag("GameController").GetComponent <SpawnStuff> ();
     player            = GameObject.FindWithTag("Player");
     gameOverText.text = "";
 }