Пример #1
0
    // Update is called once per frame
    void Update()
    {
        time -= Time.deltaTime;

        if (time < 0)
        {
            ownImage.sprite = Utilities.RandomValue(idleSprites);
            float changeTime = Mathf.Lerp(minChange, maxChange, controller.CalmFactor());
            time = Random.Range(changeTime - 0.7f, changeTime + 0.7f);
            ownImage.transform.localScale    = Random.Range(0, 2) == 0 ? Vector3.one : new Vector3(-1f, 1f, 1f);
            ownImage.rectTransform.sizeDelta = new Vector2(100, 100);
        }
    }