// Start is called before the first frame update
 void Start()
 {
     Interaction_Animator = Interaction.GetComponent <Animator>();
     House_Animator       = House.GetComponent <Animator>();
     menuPause            = Canvas.GetComponent <Pause_Menu>();
     cam             = Camera.main;
     InteractionColl = Interaction.GetComponent <Collider2D>();
     WindowColl      = Window.GetComponent <Collider2D>();
 }
예제 #2
0
    // Button that selects the rock
    public void rock()
    {
        mBall.SetActive(false);
        mRock.SetActive(true);

        Physics.gravity = Constants.ROCK_GRAVITY;

        Pause_Menu.activateGame();
        mObjects_Menu.SetActive(false);
    }
예제 #3
0
 void Start()
 {
     menuPause    = Canvas.GetComponent <Pause_Menu>();
     cam          = Camera.main;
     BoomboxColl  = Boombox.GetComponent <Collider2D>();
     StairsColl   = Stairs.GetComponent <Collider2D>();
     Curtain1Coll = Curtain1.GetComponent <Collider2D>();
     Curtain2Coll = Curtain2.GetComponent <Collider2D>();
     WindowColl   = Window.GetComponent <Collider2D>();
     DogColl      = ChouquetteTROMIMI.GetComponent <Collider2D>();
 }
예제 #4
0
 // Start is called before the first frame update
 void Start()
 {
     Interaction_Animator = Interaction.GetComponent <Animator>();
     House_Animator       = House.GetComponent <Animator>();
     menuPause            = Canvas.GetComponent <Pause_Menu>();
     cam             = Camera.main;
     InteractionColl = Interaction.GetComponent <Collider2D>();
     WindowKitchColl = WindowKITCH.GetComponent <Collider2D>();
     StairsColl      = Stairs.GetComponent <Collider2D>();
     CurtainColl     = Curtain.GetComponent <Collider2D>();
 }
 // Start is called before the first frame update
 void Start()
 {
     Magnet_Animator = Magnet.GetComponent <Animator>();
     Dishes_Animator = Dishes.GetComponent <Animator>();
     House_Animator  = House.GetComponent <Animator>();
     menuPause       = Canvas.GetComponent <Pause_Menu>();
     cam             = Camera.main;
     MagnetColl      = Magnet.GetComponent <Collider2D>();
     DishesColl      = Dishes.GetComponent <Collider2D>();
     WindowColl      = Window.GetComponent <Collider2D>();
 }
예제 #6
0
     /*************************************************************************************************
     *** Start
     *************************************************************************************************/
     void Awake()
     {
          //Set the Slingshot singleton S
          S = this;

          pauseMenu = FindObjectOfType<Pause_Menu>();

          launchPoint.SetActive(false);
          launchPos = launchPoint.transform.position;

     }//void Start
예제 #7
0
    void Start()
    {
        HealthBar = GetComponent <Slider>();

        levelManager = FindObjectOfType <LevelManager>();
        LivesManager = FindObjectOfType <Lives_Manager>();
        PauseMenu    = FindObjectOfType <Pause_Menu>();

        PlayerHealth = PlayerPrefs.GetInt("Health");

        IsDead = false;
    } //void Start
예제 #8
0
    /*************************************************************************************************
    *** Start
    *************************************************************************************************/
    private void Start()
    {
        Disk      = FindObjectOfType <Disk_Controller>();
        pauseMenu = FindObjectOfType <Pause_Menu>();

#if UNITY_ANDROID
        TouchControls.SetActive(true);
#endif

#if UNITY_STANDALONE || UNITY_WEBGL
        TouchControls.SetActive(false);
#endif
    }
 // Start is called before the first frame update
 void Start()
 {
     Interaction_Animator = Interaction.GetComponent <Animator>();
     House_Animator       = House.GetComponent <Animator>();
     menuPause            = Canvas.GetComponent <Pause_Menu>();
     cam             = Camera.main;
     InteractionColl = Interaction.GetComponent <Collider2D>();
     WindowBedColl   = WindowBED.GetComponent <Collider2D>();
     WindowBathColl  = WindowBATH.GetComponent <Collider2D>();
     CurtainColl     = Curtain.GetComponent <Collider2D>();
     MirrorColl      = Mirror.GetComponent <Collider2D>();
     BlanketColl     = Blanket.GetComponent <Collider2D>();
 }
 // Start is called before the first frame update
 void Start()
 {
     Interaction_Animator = Interaction.GetComponent <Animator>();
     House_Animator       = House.GetComponent <Animator>();
     menuPause            = Canvas.GetComponent <Pause_Menu>();
     cam                = Camera.main;
     InteractionColl    = Interaction.GetComponent <Collider2D>();
     WindowTriangleColl = WindowTRIANGLE.GetComponent <Collider2D>();
     StairsColl         = Stairs.GetComponent <Collider2D>();
     Curtain1Coll       = Curtain1.GetComponent <Collider2D>();
     Curtain2Coll       = Curtain2.GetComponent <Collider2D>();
     WindowColl         = Windows.GetComponent <Collider2D>();
     KeysColl           = Keys.GetComponent <Collider2D>();
 }
 // Start is called before the first frame update
 void Start()
 {
     LampNight_Animator = LampNight.GetComponent <Animator>();
     Candle_Animator    = Candle.GetComponent <Animator>();
     TVLight_Animator   = TVLight.GetComponent <Animator>();
     House_Animator     = House.GetComponent <Animator>();
     menuPause          = Canvas.GetComponent <Pause_Menu>();
     cam           = Camera.main;
     LampNightColl = LampNight.GetComponent <Collider2D>();
     CandleColl    = Candle.GetComponent <Collider2D>();
     TVLightColl   = TVLight.GetComponent <Collider2D>();
     CurtainColl   = Curtain.GetComponent <Collider2D>();
     StairsColl    = Stairs.GetComponent <Collider2D>();
 }
예제 #12
0
        public void GameOver()
        {
            Debug.Log("GAME OVER");
            //enable gameover script and display
            gameOverMenuUI.SetActive(true);
            GameOver_Menu gom = FindObjectOfType <GameOver_Menu> ();

            gom.enabled = true;

            //disable pause menu script
            Pause_Menu pm = FindObjectOfType <Pause_Menu> ();

            pm.enabled = false;             //disable pause menu script to avoid interaction
        }
예제 #13
0
 // Start is called before the first frame update
 void Start()
 {
     SubScene_Animator = GetComponent <Animator>();
     Keys_Animator     = Keys.GetComponent <Animator>();
     House_Animator    = House.GetComponent <Animator>();
     cam          = Camera.main;
     CurtainsColl = Curtains.GetComponent <Collider2D>();
     KeysColl     = Keys.GetComponent <Collider2D>();
     LampColl     = Lamp.GetComponent <Collider2D>();
     Curtain1Coll = Curtain1.GetComponent <Collider2D>();
     Curtain2Coll = Curtain2.GetComponent <Collider2D>();
     StairsColl   = Stairs.GetComponent <Collider2D>();
     menuPause    = Canvas.GetComponent <Pause_Menu>();
 }
예제 #14
0
 // Start is called before the first frame update
 void Start()
 {
     BedLamp1_Animator = BedLamp1.GetComponent <Animator>();
     BedLamp2_Animator = BedLamp2.GetComponent <Animator>();
     Window_Animator   = Window.GetComponent <Animator>();
     House_Animator    = House.GetComponent <Animator>();
     menuPause         = Canvas.GetComponent <Pause_Menu>();
     cam          = Camera.main;
     BedLamp1Coll = BedLamp1.GetComponent <Collider2D>();
     BedLamp2Coll = BedLamp2.GetComponent <Collider2D>();
     WindowColl   = Window.GetComponent <Collider2D>();
     MirrorColl   = Mirror.GetComponent <Collider2D>();
     BlanketColl  = Blanket.GetComponent <Collider2D>();
 }
예제 #15
0
     /*************************************************************************************************
     *** Start
     *************************************************************************************************/
     void Start()
     {
          //Find a reference to the Text-Score GameObject
          GameObject scoreGO = GameObject.Find("Text - Score");

          //Get the Text component of that GameObject
          scoreText = scoreGO.GetComponent<Text>();

          //Set the starting number of points to 0
          score = 0;
          scoreText.text = "Score: " + score.ToString();

          pauseMenu = FindObjectOfType<Pause_Menu>();

     }//void Start
 // Start is called before the first frame update
 void Start()
 {
     Web1_Animator     = Web1.GetComponent <Animator>();
     Web2_Animator     = Web2.GetComponent <Animator>();
     Portrait_Animator = Portrait.GetComponent <Animator>();
     Mannikin_Animator = Mannikin.GetComponent <Animator>();
     House_Animator    = House.GetComponent <Animator>();
     menuPause         = Canvas.GetComponent <Pause_Menu>();
     cam          = Camera.main;
     Web1Coll     = Web1.GetComponent <Collider2D>();
     Web2Coll     = Web2.GetComponent <Collider2D>();
     PortraitColl = Portrait.GetComponent <Collider2D>();
     MannikinColl = Mannikin.GetComponent <Collider2D>();
     WindowColl   = Window.GetComponent <Collider2D>();
 }
예제 #17
0
    // Button that sets the game difficulty to impossible
    public void impossible()
    {
        // Only do if not already normal so you don't reset the score if
        // you are already on normal
        if (difficulty != Constants.IMPOSSIBLE)
        {
            difficulty = Constants.IMPOSSIBLE;

            // Resets the score and sets the bucket
            Floor.reset = true;;
            setBucket(Constants.IMPOSSIBLE);
        }

        Pause_Menu.activateGame();
        mDifficulty_Menu.SetActive(false);
    }
 // Start is called before the first frame update
 void Start()
 {
     Bath_Animator    = Bath.GetComponent <Animator>();
     Shower_Animator  = Shower.GetComponent <Animator>();
     Paint_Animator   = Paint.GetComponent <Animator>();
     Mirror_Animator  = Mirror.GetComponent <Animator>();
     Machine_Animator = Machine.GetComponent <Animator>();
     House_Animator   = House.GetComponent <Animator>();
     menuPause        = Canvas.GetComponent <Pause_Menu>();
     cam         = Camera.main;
     BathColl    = Bath.GetComponent <Collider2D>();
     ShowerColl  = Shower.GetComponent <Collider2D>();
     PaintColl   = Paint.GetComponent <Collider2D>();
     MirrorColl  = Mirror.GetComponent <Collider2D>();
     MachineColl = Machine.GetComponent <Collider2D>();
     WindowColl  = Window.GetComponent <Collider2D>();
 }
예제 #19
0
    // Controls button interaction
    void Update()
    {
        // Pressing the grip button pauses the game
        if (controller.GetPressDown(gripButton))
        {
            Pause_Menu.disableGame();
            mPause_Menu.SetActive(true);
        }

        // Pressing the trigger button throws or holds the item
        if (controller.GetPressDown(triggerButton) && mItem)
        {
            if (mItem.isHolding)
            {
                mItem.fling(this);
            }
            else
            {
                mItem.hold(this);
            }
        }
    }
예제 #20
0
    void Start()
    {
        box = Infobox;
        Infobox.SetActive(false);
        myList.Add("Bear", animalImages[0]);                            // Populates list for animal images
        myList.Add("Hare", animalImages[1]);
        myList.Add("Moose", animalImages[2]);
        myList.Add("Wolf", animalImages[3]);

        place = new Transform[10];
        place = InfoPanel.GetComponentsInChildren <RectTransform>();    // Get array of RectTransform for placing boxes

        isOpen      = new bool[8];                                      // Initilising arrays
        clones      = new GameObject[8];
        sliders     = new Slider[8][];
        texts       = new Text[8][];
        animalIDs   = new int[8];
        animalNames = new string[8];

        igu = FindObjectOfType <In_Game_UI>();
        pm  = FindObjectOfType <Pause_Menu>();
    }
예제 #21
0
    //  // Called every frame. 'delta' is the elapsed time since the previous frame.
    public override void _Process(float delta)
    {
        time_after_pause += delta;
        if (time_after_pause < .2f)
        {
            return;
        }

        score = ((int)Position.y) / 128 + data.Get <depth>();
        Debug.Label("Depth:", score);

        statemachine.Update(data, delta);

        if (pause && !GetTree().Paused)
        {
            time_after_pause = 0;
            var menu = new Pause_Menu();
            this.FindChild <Control>().AddChild(menu);
            menu.SetPosition(new Vector2(0, 0));
        }

        ref var invincible = ref data.Get <invincible>();
예제 #22
0
 // Start is called before the first frame update
 void Start()
 {
     LampA_Animator  = LampA.GetComponent <Animator>();
     LampB_Animator  = LampB.GetComponent <Animator>();
     TV_Animator     = TV.GetComponent <Animator>();
     Carpet_Animator = Carpet.GetComponent <Animator>();
     Table_Animator  = Table.GetComponent <Animator>();
     Shoes_Animator  = Shoes.GetComponent <Animator>();
     Hanger_Animator = Hanger.GetComponent <Animator>();
     House_Animator  = House.GetComponent <Animator>();
     menuPause       = Canvas.GetComponent <Pause_Menu>();
     cam             = Camera.main;
     LampAColl       = LampA.GetComponent <Collider2D>();
     LampBColl       = LampB.GetComponent <Collider2D>();
     TVColl          = TV.GetComponent <Collider2D>();
     CarpetColl      = Carpet.GetComponent <Collider2D>();
     TableColl       = Table.GetComponent <Collider2D>();
     ShoesColl       = Shoes.GetComponent <Collider2D>();
     HangerColl      = Hanger.GetComponent <Collider2D>();
     KeysColl        = Keys.GetComponent <Collider2D>();
     Curtain1Coll    = Curtain1.GetComponent <Collider2D>();
     Curtain2Coll    = Curtain2.GetComponent <Collider2D>();
     StairsColl      = Stairs.GetComponent <Collider2D>();
 }
예제 #23
0
 // Button that resumes the game
 public void resume()
 {
     Pause_Menu.activateGame();
     mDifficulty_Menu.SetActive(false);
 }
예제 #24
0
	// Use this for initialization
	void Start () {
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible = false;
        rb = GetComponent<Rigidbody>();
        //tf = GetComponent<Transform>();
        sensitivity = 120; // initialize at default sensitivity; to be tweakable live in the future
        dodgeFlag = true;
        SpawnFlag = true;
        currentHP = maxHP;

        //Loading keyconfig
        //defaultKeys = new Dictionary<string, string>
        //{
        //    { "left","a" },
        //    { "right","d" },
        //    {"forward","w" },
        //    { "backward","s" },
        //    {"jump","space" },
        //    {"dodge", "left shift" },

        //};
        //keys = new Dictionary<string, string>();
        //try
        //{
        //    StreamReader f = new StreamReader("keys.cfg");
        //    string line;
        //    while ((line = f.ReadLine()) != null)
        //    {
        //        string[] splitted = line.Split(':');
        //        if (!defaultKeys.ContainsKey(splitted[0]))
        //        {
        //            Debug.Log("Key not used: " + splitted[0]);
        //        }
        //        else
        //        {
        //            keys[splitted[0]] = splitted[1];
        //        }

        //    }
        //    f.Close();
        //    using (StreamWriter sw = File.AppendText("keys.cfg"))
        //    {
        //        foreach (string key in defaultKeys.Keys)
        //        {
        //            if (!keys.ContainsKey(key))
        //            {
        //                //Add key to file if it doesn't exist
        //                sw.Write(key + ":" + defaultKeys[key] + "\n");
        //                //Add key to settings
        //                keys[key] = defaultKeys[key];
        //            }
        //        }
        //    }
        //}
        //catch (IOException)
        //{
        //    //File doesn't exist yet, create it
        //    using (StreamWriter sw = File.CreateText("keys.cfg"))
        //    {
        //        foreach (string key in defaultKeys.Keys)
        //        {
        //            sw.Write(key + ":" + defaultKeys[key] + "\n");
        //            keys[key] = defaultKeys[key];
        //        }
        //    }
        //}
        pauseMenu = GameObject.FindObjectOfType<Pause_Menu>();
    }
예제 #25
0
 // Button that resumes the game
 public void resume()
 {
     Pause_Menu.activateGame();
     mObjects_Menu.SetActive(false);
 }
 public Level_1_Screen(Screen_Manager screen_manager, World _world, GameCamera _camera, PenumbraComponent _lighting, Particle_World _particle_world, Physics_Engine _physics_engine, Lua lua, GraphicsDevice device) : base(_world, _camera, _lighting, _particle_world, _physics_engine, lua, device, "Level 1")
 {
     //sky = new Sky_Renderer(Assets.It.Get<Texture2D>("sky_1"), false);
     world      = _world;
     pause_menu = new Pause_Menu(screen_manager, camera);
 }