Exemplo n.º 1
0
 public void ShowHP(GameObject a, float b) //显示血量
 {
     HP_Panel.SetActive(true);
     HP_Panel.transform.position = a.transform.position + Vector3.up * b;
     HP_Panel.transform.rotation = Camera.main.transform.rotation;
     HPText.GetComponent <UnityEngine.UI.Text>().text = "HP:" + GameFunc.GetObjectShuxing(GameFunc.GetMousePointedObject()).Hp.ToString(); //显示血量
 }
Exemplo n.º 2
0
    public void ShowState(GameObject b) //显示状态
    {
        Shuxing a = GameFunc.GetObjectShuxing(b);

        State_Panel.SetActive(true);
        State_Text.GetComponent <UnityEngine.UI.Text>().text = ("职业:" + a.Name + "\n" + a.GetState());
    }
Exemplo n.º 3
0
 public void Place()
 {
     GameFunc.GetObjectShuxing(Game.NewObject).isBeingPlaced = false;
     Game.GameSystemCurrent.IsPlacing = false;
     GameFunc.GetObjectShuxing(Game.NewObject).BelongToWho = Game.GameSystemCurrent.Side;
     Game.NewObject = null;
 }
Exemplo n.º 4
0
 public static void GenerateRider()
 {
     if (NewObject == null)
     {
         NewObject = GameObject.Instantiate(Resources.Load <GameObject>("Prefabs/Units/rider"));
         GameFunc.GetObjectShuxing(NewObject).isBeingPlaced = true;
         Game.GameSystemCurrent.IsPlacing = true;
     }
 }
Exemplo n.º 5
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     //Debug.Log(GameFunc.GetObjectShuxing(gameObject).BelongToWho.ToString());
     if (gameObject.tag == "a" && (GameFunc.GetObjectShuxing(gameObject).BelongToWho == Game.GameSystemCurrent.Side))
     {
         UI_Script.ShowHP(gameObject, gameObject.GetComponent <UnitMain>().Top_Offset);
         UI_Script.ShowState(gameObject);
         UI_Script.ShowCirle(gameObject);
     }
 }
Exemplo n.º 6
0
 public void Generate(UnitType unitType)
 {
     if (Game.NewObject == null)
     {
         UnitTypes unit = new UnitTypes(unitType);
         Game.NewObject = GameObject.Instantiate(Resources.Load <GameObject>(unit.PrefabLocation));
         GameFunc.GetObjectShuxing(Game.NewObject).isBeingPlaced = true;
         Game.GameSystemCurrent.IsPlacing = true;
     }
 }
Exemplo n.º 7
0
    public void OnPointerClick(PointerEventData eventData)
    {
        Shuxing a;

        a = GameFunc.GetObjectShuxing(UnitGeneration.NewObject);
        //bool finish = generate_script.finish;
        //GameObject NewObject = generate_script.NewObject;
        if (a != null)
        {
            a.BelongToWho   = Game.GameSystemCurrent.Side;
            a.isBeingPlaced = false;
            Game.GameSystemCurrent.IsPlacing = false;
            UnitGeneration.NewObject         = null;
        }
    }