Beispiel #1
0
    void Update()
    {
        item = GameObject.FindGameObjectsWithTag("Item");

        if (rotZ < -90 || rotZ > 90)
        {
            ModelScale.y = scaleFY * -1;
            Indicator.transform.localScale = new Vector3(scaleFX, ModelScale.y, scaleFZ);
        }
        else
        {
            ModelScale.y = scaleFY;
            Indicator.transform.localScale = new Vector3(scaleFX, ModelScale.y, scaleFZ);
        }

        if (item.Length <= 0)
        {
            A_.DeActivate(Pointer);
            SpRenderer.sprite = none;
        }

        if (item.Length > 0)
        {
            A_.Activate(Pointer);
            Vector3 difference = item[0].transform.position - transform.position;
            ItemSpRenderer    = item[0].GetComponent <SpriteRenderer>();
            itemSprite        = ItemSpRenderer.sprite;
            SpRenderer.sprite = itemSprite;
            rotZ = Mathf.Atan2(difference.y, difference.x) * Mathf.Rad2Deg;
            transform.rotation = Quaternion.Euler(0f, 0f, rotZ + offset);
        }
    }
Beispiel #2
0
 public void Resume()
 {
     A_.DeActivate(PauseMenu);
     StaticVals.isPaused = false;
 }