Exemple #1
0
    void Update()
    {
        offset    = Game_Manager.Map(cam.orthographicSize, pinch.minZoom, pinch.maxZoom, minOff, maxOff);
        topStartY = top.transform.position.y;

        belowPopUp = new Vector3(abovePopUp.x, abovePopUp.y - offset, abovePopUp.z);

        if (loadScene)
        {
            if (Vector2.Distance(transform.position, player.transform.position) < 1f)
            {
                Game_Manager.SavePlayerPos(transform.position);
                transform.GetComponent <Site_Info>().LoadCorrespondingScene();
            }
        }

        if (showing)
        {
            Vector3 topScreen = cam.ScreenToWorldPoint(new Vector3(cam.pixelWidth / 2, cam.pixelHeight, 0));

            float topScreenY = topScreen.y + Game_Manager.Map(offset, minOff, maxOff, 5f, 45f);


            if (topStartY > topScreenY)
            {
                popUp.transform.position = belowPopUp;
            }
            else
            {
                popUp.transform.position = abovePopUp;
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        speed = Game_Manager.Map(cam.orthographicSize, camMin, camMax, 0.025f, 0.1f);

        if (Input.touchCount > 1)
        {
            Vector2 touchDeltaPosition = Input.GetTouch(0).deltaPosition;
            transform.Translate(-touchDeltaPosition.x * speed, -touchDeltaPosition.y * speed, 0);
        }
    }
Exemple #3
0
    // Update is called once per frame
    void Update()
    {
        minCamSize = pinch.minZoom;
        maxCamSize = pinch.maxZoom;

        float scale = Game_Manager.Map(Camera.main.orthographicSize, minCamSize, maxCamSize, minScale, maxScale);

        newScale = new Vector3(scale, scale, 0);

        transform.localScale = newScale;
    }
Exemple #4
0
    void AdjustTrail()
    {
        float time;

        time       = Game_Manager.Map(movementSpeed, MinSpeed, MaxSpeed, 0, 5);
        trail.time = time;
        float a;

        a = Game_Manager.Map(movementSpeed, MinSpeed, MaxSpeed, 0f, 1f);
        Color col    = new Color(1, 1, 1, a);
        Color endCol = new Color(1, 1, 1, 0);

        //maybe add colours as public variables and have them settable in editor to any colour

        trail.startColor = col;
        trail.endColor   = endCol;
    }
 void AdjustParticleSystem()
 {
     mm.startSize        = Game_Manager.Map(movementSpeed, MinSpeed, MaxSpeed, 2f, 2f);
     mm.startLifetime    = Game_Manager.Map(movementSpeed, MinSpeed, MaxSpeed, 4f, 2f);
     em.rateOverDistance = Game_Manager.Map(movementSpeed, MinSpeed, MaxSpeed, 0.75f, 2f);
 }
    // Update is called once per frame
    void Update()
    {
        float newVolume = Game_Manager.Map(_PMM.movementSpeed, _PMM.MinSpeed, _PMM.MaxSpeed, 0f, 1f);

        Source.volume = newVolume;
    }