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(); //显示血量 }
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()); }
public void Place() { GameFunc.GetObjectShuxing(Game.NewObject).isBeingPlaced = false; Game.GameSystemCurrent.IsPlacing = false; GameFunc.GetObjectShuxing(Game.NewObject).BelongToWho = Game.GameSystemCurrent.Side; Game.NewObject = null; }
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); }
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)); } }
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; } }
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; }
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; } }
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); } }
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)); } }
// 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)); } }
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; } }
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; } }
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); */ }
/// <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); }
// 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; }
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); }