Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (mTarget == null)
        {
            return;
        }

        if (!mTarget.IsLive())
        {
            mTarget = null;
            Destroy(gameObject);
            return;
        }

        Vector3 pos = mTarget.GetPos() * CGameScaller.GetInstance().GetScale();// - CGameManager.GetInstance().GetPos();

        pos -= CGameManager.GetInstance().GetPos();

        pos.x *= 1.0f / 20.0f;
        pos.y *= 1.0f / 20.0f;

        if (pos.x < -50.0f || pos.x > 50.0f || pos.y < -50.0f || pos.y > 50.0f)
        {
            EnableImage(false);
        }
        else
        {
            SetPos(pos.x, pos.y);
            EnableImage(true);
        }
    }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        if (mPlayer != null)
        {
            mPlayer.UpdateUnit();

            Vector3 playerPos = mPlayer.GetPos();

            playerPos  *= CGameScaller.GetInstance().GetScale();
            playerPos.z = 1.0f;

            mTransform.position = playerPos;
        }

        if (mEnemy != null)
        {
            mEnemy.UpdateUnit();
        }

        for (int i = 0; i < MAX_BULLET; ++i)
        {
            if (mPlayerBulletList[i] != null)
            {
                mPlayerBulletList[i].UpdateUnit();
            }

            if (mEnemyBulletList[i] != null)
            {
                mEnemyBulletList[i].UpdateUnit();
            }
        }
    }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        if (mTarget.GetStatus() == CUnit.UNIT_STATUS.US_DYING)
        {
            Destroy(gameObject);
            return;
        }

        Vector3 pos = mTarget.GetPos() * CGameScaller.GetInstance().GetScale();

        pos  -= CGameManager.GetInstance().GetPos();
        pos.z = 1.0f;

        pos   *= 1.0f / CUIManager.GetInstance().GetScaleFactor();
        pos.y += 25;

        SetPos(pos.x, pos.y);

        SetValue(mTarget.GetHpPercent());
    }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     ScaleBg();
     mInstance = this;
 }