Пример #1
0
    // Update is called once per frame
    void Update()
    {
        MovingEntity parent = transform.parent.gameObject.GetComponent <MovingEntity>();

        localScale.x = (float)initial * ((float)parent.getHP() / (float)parent.getMaxHP());
        //Debug.Log(localScale.x);
        transform.localScale = localScale;
    }