Example #1
0
    public void setAiming(Vector2 screenPos, float iconHeight, bool isAim)
    {
        LayoutTools.ACTIVE_WINDOW(mAiming, isAim);
        LayoutTools.ACTIVE_WINDOW(mGreenAimingAnim, !isAim);
        float   heightScale = iconHeight / mOriginHeight;
        Vector2 scale       = new Vector2(heightScale, heightScale);

        if (isAim)
        {
            mAiming.setLocalPosition(UnityUtility.screenPosToWindowPos(screenPos, mAiming.getParent(), true));
            LayoutTools.SCALE_WINDOW(mAiming, scale);
        }
        else
        {
            mGreenAimingAnim.setLocalPosition(UnityUtility.screenPosToWindowPos(screenPos, mAiming.getParent(), true));
            LayoutTools.SCALE_WINDOW(mGreenAimingAnim, scale);
        }
    }