using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;

public class HoppingBattleMainUI : BattleMainUI
{
    public HoppingBattleController hoppingBattleController  => this.battleController as HoppingBattleController;
    
    public RectTransform finger;
    public NumShow scoreText;
    public GameObject[] UIs;

    public TextMeshProUGUI CubeNumber;
   
    public GameObject Hp;
    public HoppingBattle3DScene hoppingBattle3DScene => this.battle3dScene as HoppingBattle3DScene;

    public GameObject StarsPar;

    public GameObject Inforation;

    public override void Awake()
    {
        base.Awake();
        scoreText.num = 0;
    }

    public GameObject StarsPar2;
    public override void Start()
    {
        base.Start();
      //  eight.SetActive(false);
       
        
    }


    private void LateUpdate()
    {
       
    }
    public override void OnClickStart()
    {
        base.OnClickStart();

    }

    public override void Init(BattleController mController)
    {
        base.Init(mController);

    }
    

    private void OnPointerDown(int pointer, Vector3  position)
    {
       
        
    }

    private void OnPointerMove(int pointer, Vector3 position)
    {
       
        
    }
    
    private void OnPointerUp(int pointer, Vector3 position)
    {
        
    }

    public void GotoShop()
    {
        BattleUIDisplayController battleUIDisplayController = GetComponentInParent<BattleUIDisplayController>();
        battleUIDisplayController.GotoShop();
    }



    public void GotoCs() 
    {
        BattleUIDisplayController battleUIDisplayController = GetComponentInParent<BattleUIDisplayController>();
        battleUIDisplayController.CsPlanel();
    }
    /// <summary>
    /// 是否隐藏UI
    /// </summary>
    public static bool s_HideUI;
    
    /// <summary>
    /// 延迟隐藏手指
    /// </summary>
    private int FingerFrameCount;

    public int m_OldLife;
    /// <summary>
    /// 星
    /// </summary>
    public GameObject[] stars;

    private int  Currentstar = 0;
    private float Currentheight = 0;
    private int old_star = 0;
    /// <summary>
    /// 界面的星
    /// </summary>
    public GameObject[] stars2;
    public Slider heightSlider;

    public GameObject eight;

    public GameObject Started;
    void Update()
    {
       
       
       
        if (Input.GetMouseButton(0))
        {
            if (finger && s_HideUI)
            {
                if (!finger.gameObject.activeSelf)
                {
                    FingerFrameCount = 0;
                    finger.gameObject.SetActive(true);
                }

                finger.SetUIPosition(this.uiCamera.ScreenToWorldPoint(Input.mousePosition));
                //finger.rectTransform.SetUIPosition(pos);
            }
        }
        else
        {
            if (finger && finger.gameObject.activeSelf)
            {
                FingerFrameCount++;
                if (FingerFrameCount >= 5 || !s_HideUI)
                    finger.gameObject.SetActive(false);
            }
        }

      
      
      
    }

    [ContextMenu("TestGotoResult")]
     public  void TestGotoResult()
    {
        BattleResult testResult = new BattleResult();

        GetComponentInParent<BattleSceneDisplayController>().ShowResult(testResult);
     }
}
