Ejemplo 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(); //显示血量
 }
Ejemplo 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());
    }
Ejemplo 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;
 }
Ejemplo n.º 4
0
 public void vnscenescript_run_filescene(string file, GameFunc onEnd)
 {
     this.runScAct = onEnd;
     this.load_scene(file);
     this.set_text_s("...");
     this.set_buttons_alt(new List <Button_s>());
     this.set_timer(0.5f, this._vnscenescript_run_filescene);
 }
Ejemplo n.º 5
0
 private void Update()
 {
     if (StatusCheck())
     {
         transform.localScale = GameFunc.LookAtVector3(transform.position, gameDirector.player.transform.position);
         rigidBody2D.MovePosition(Vector2.MoveTowards(transform.position, gameDirector.player.transform.position, Speed));
     }
 }
Ejemplo n.º 6
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;
     }
 }
Ejemplo n.º 7
0
		public virtual GameFunc ToGameFunc()
		{
			GameFunc gf = new GameFunc();
			gf.SetKey(key);
			gf.SetName(name);
			gf.SetDesc(desc);
			gf.SetAction(action);
			gf.SetArgs(args);
			return gf;
		}
Ejemplo n.º 8
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;
     }
 }
Ejemplo n.º 9
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);
     }
 }
Ejemplo n.º 10
0
 private void Update()
 {
     if (StatusCheck())
     {
         var me     = transform;
         var player = gameDirector.player.transform;
         transform.localScale = GameFunc.LookAtVector3(me.position, player.position);
         rigid2D.MovePosition(Vector2.MoveTowards(me.position, new Vector2(me.position.x, player.position.y), Speed));
     }
 }
Ejemplo n.º 11
0
    // Update is called once per frame
    void Update()
    {
        Vector3 position;

        if (UnitGeneration.NewObject != null)
        {
            position   = GameFunc.GetMousePointedPosition();
            position.y = Plane.transform.position.y + 10f;
            UnitGeneration.NewObject.transform.position = position;
        }
    }
 private void Update()
 {
     if (StatusCheck())
     {
         transform.localScale =
             GameFunc.LookAtVector3(transform.position, gameDirector.player.transform.position, false);
         // Y座標を合わせるように移動
         Vector3 target = transform.position;
         target.y = gameDirector.player.transform.position.y;
         rigidBody2D.MovePosition(Vector3.MoveTowards(transform.position, target, Speed));
     }
 }
Ejemplo n.º 13
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;
        }
    }
Ejemplo n.º 14
0
    private void OnRefreshFlag(GameFunc func, bool show)
    {
        switch (func)
        {
        case GameFunc.NONE:
            ClearAllFlags();
            break;

        case GameFunc.BAG:
            if (_imgBagFlag != null)
            {
                _imgBagFlag.gameObject.SetActive(show);
            }
            break;
        }
    }
Ejemplo n.º 15
0
        public void vnscenescript_run_current(GameFunc onEnd, string startState = "0")
        {
            //print "Run current!"

            /*
             * MenuFunc func = VNSceneScript.start_menu;
             * this.run_menu(func, new Dictionary<string, string> {
             *  {
             *      "mode",
             *      "view"
             *  },
             *  {
             *      "startState",
             *      startState
             *  }
             * }, onEnd);
             */
        }
Ejemplo n.º 16
0
 /// <summary>
 /// 現在のステータスを確認
 /// </summary>
 /// <returns>行動可能</returns>
 public virtual bool StatusCheck()
 {
     switch (Status)
     {
     case CharacterStatus.Freeze:
     {
         freezeTime -= Time.deltaTime;
         if (freezeTime <= 0)
         {
             freezeTime = 0f;
             Status     = CharacterStatus.None;
             GameFunc.PauseObject(gameObject, true);
         }
         else
         {
             return(false);
         }
     }
     break;
     }
     return(true);
 }
Ejemplo n.º 17
0
 // Update is called once per frame
 void Update()
 {
     if (time > (stage_Time + ready_Time + go_Time))
     {
         GameFunc.PauseObjects(GameObject.FindGameObjectsWithTag("Player"), true);
         GameFunc.PauseObjects(GameObject.FindGameObjectsWithTag("Enemy"), true);
         Destroy(gameObject);
     }
     else
     {
         if (time > (stage_Time + ready_Time))
         {
             countText.text = "GO!";
         }
         else
         {
             if (time > (stage_Time))
             {
                 countText.text = "READY";
             }
         }
     }
     time += Time.deltaTime;
 }
Ejemplo n.º 18
0
 public void ShootIce()
 {
     GameFunc.ShootSomething(icePool, bullet_from.position, bullet_to.position);
 }
 public void ShootDarkBall()
 {
     GameFunc.ShootSomething(darkBallPool, bullet_from[0].position, bullet_to[0].position);
 }