Esempio n. 1
0
 void OnTriggerExit2D(Collider2D c)
 {
     if (c.gameObject.name == "Mouse")
     {
         mainCamera.deleteDrawingOfScreen(drawBubble);
         drawBubble = null;
         target.GetComponent<playerController>().set_speed(o_speed);
     }
 }
 // Use this for initialization
 void Start()
 {
     speed = GameObject.Find ("Mouse").GetComponent<playerController> ().get_speed ();
     player = GetComponent<Transform>();
     playerScript = GetComponent<playerController>();
     moveToSpawn = true;
     levelStart = true; //Disable later - Enabled for testing
     deathTimer = 0.0f;
     timerOn = false;
     keyDraw = null;
 }
 void drawKey()
 {
     if (playerScript.getKeyState() && keyDraw == null)
     {
         keyDraw = new DrawScreen("key1", textureKey, 30, false);
         cameraScript.addDrawingToScreen(keyDraw);
     }
     else if (!playerScript.getKeyState() && keyDraw != null)
     {
         cameraScript.deleteDrawingOfScreen(keyDraw);
         keyDraw = null;
     }
 }
Esempio n. 4
0
    void OnTriggerEnter2D(Collider2D c)
    {
        if (c.gameObject.name == "Mouse")
        {
            audio = GetComponent<AudioSource>();
            if (!audio.isPlaying)
            {
                audio.Play();
            }
            target = c.gameObject;
            sticking = true;
            o_speed = target.GetComponent<playerController>().get_speed();
            target.GetComponent<playerController>().set_speed(1.2f);

            drawBubble = new DrawScreen("", bubbleTexture, 30, true);
            mainCamera.addDrawingToScreen(drawBubble);
        }
    }
    private void drawTexture_right(DrawScreen newObject, int gapItems, int sizeItem)
    {
        newObject.setWidthTexture(sizeItem);
        numberItem_Right++;
        sumWidth_Right += newObject.getWidthTexture();

        int posX = Screen.width - sumWidth_Right - gapItems - gapItems*(numberItem_Right - 1);
        int posY = Screen.height - gapItems - sizeItem;

        GUI.DrawTexture(new Rect(posX, posY, newObject.getWidthTexture(), sizeItem), newObject.getMyTexture(), ScaleMode.ScaleToFit, true);
    }
 public void deleteDrawingOfScreen(DrawScreen deleteDraw)
 {
     textureScreen.Remove(deleteDraw);
 }
 public void addDrawingToScreen(DrawScreen newDraw )
 {
     textureScreen.Add(newDraw);
 }