本文整理汇总了C#中Message.makeMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Message.makeMessage方法的具体用法?C# Message.makeMessage怎么用?C# Message.makeMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Message
的用法示例。
在下文中一共展示了Message.makeMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnClick
// Use this for initialization
public void OnClick()
{
//Check
Message msg = new Message();
if (requiredItem == false || requiredMoney == false) {
//Error
string Text = "物資が不足しておりますぞ。";
msg.makeMessage (Text);
} else {
//OK
//Decrease Item Qty
if(itemType == "low"){
int hidensyoGeQty = PlayerPrefs.GetInt ("hidensyoGe");
hidensyoGeQty = hidensyoGeQty - requiredItemQty;
PlayerPrefs.SetInt ("hidensyoGe", hidensyoGeQty);
}else if(itemType == "middle"){
int hidensyoCyuQty = PlayerPrefs.GetInt ("hidensyoCyu");
hidensyoCyuQty = hidensyoCyuQty - requiredItemQty;
PlayerPrefs.SetInt ("hidensyoCyu", hidensyoCyuQty);
}else if(itemType == "high"){
int hidensyoJyoQty = PlayerPrefs.GetInt ("hidensyoJyo");
hidensyoJyoQty = hidensyoJyoQty - requiredItemQty;
PlayerPrefs.SetInt ("hidensyoJyo", hidensyoJyoQty);
}
//Decrease Money
int money = PlayerPrefs.GetInt ("money");
money = money - requiredMoneyAmt;
PlayerPrefs.SetInt ("money", money);
//Increase Lv of senpou
string tmp = "senpou" + busyoId;
PlayerPrefs.SetInt (tmp, nextSenpouLv);
PlayerPrefs.Flush();
//Message
string busyoName = GameObject.Find ("GameScene").GetComponent<NowOnBusyo>().OnBusyoName;
string OKtext = busyoName+"に秘伝書を授与しました。戦法効果が上がります。";
msg.makeMessage(OKtext);
//Reload
//Close Board
GameObject.Find ("close").GetComponent<CloseBoard>().onClick();
SenpouScene senpou = new SenpouScene();
senpou.createSenpouStatusView(busyoId);
}
}
示例2: OnClick
public void OnClick()
{
if (name == "YesButton") {
//Kainin
//Delete Key
int kuniId = GameObject.Find ("NaiseiController").GetComponent<NaiseiController> ().activeKuniId;
string temp = "jyosyu" + kuniId;
int busyoId = PlayerPrefs.GetInt (temp);
PlayerPrefs.DeleteKey(temp);
//JyosyuHei Kainin
string temp2 = "jyosyuHei" + busyoId;
PlayerPrefs.DeleteKey(temp2);
PlayerPrefs.Flush ();
//Close
GameObject.Find ("TouchBack").GetComponent<CloseBoard>().onClick();
//Initialization
//Message
Message msg = new Message();
string text = "城主を解任致しました。";
msg.makeMessage(text);
//Initialization
NaiseiController naisei = new NaiseiController ();
naisei.Start ();
}else if(name == "NoButton"){
//Close
GameObject.Find ("TouchBack").GetComponent<CloseBoard>().onClick();
}
}
示例3: OnClick
public void OnClick(){
int busyoDama = PlayerPrefs.GetInt ("busyoDama");
if (busyoDama >= 100) {
GameObject panel = GameObject.Find ("Panel").gameObject;
string pathOfBack = "Prefabs/Common/TouchBackForOne";
GameObject back = Instantiate (Resources.Load (pathOfBack)) as GameObject;
back.transform.SetParent (panel.transform);
back.transform.localScale = new Vector2 (1, 1);
back.transform.localPosition = new Vector2 (0, 0);
string pathOfBoard = "Prefabs/Map/common/AddHyourouBoard";
GameObject board = Instantiate (Resources.Load (pathOfBoard)) as GameObject;
board.transform.SetParent (panel.transform);
board.transform.localScale = new Vector2 (1, 1);
board.transform.localPosition = new Vector2 (0, 0);
back.GetComponent<CloseOneBoard> ().deleteObj = board;
board.transform.FindChild ("YesButton").GetComponent<AddHyourou> ().touchBackObj = back;
board.transform.FindChild ("NoButton").GetComponent<AddHyourou> ().touchBackObj = back;
} else {
Message msg = new Message ();
msg.makeMessage ("兵糧回復を行うには、\n武将珠が100個必要です。");
}
}
示例4: Start
// Use this for initialization
void Start()
{
int busyoDama = PlayerPrefs.GetInt("busyoDama");
GameObject.Find ("BusyoDamaValue").GetComponent<Text> ().text = busyoDama.ToString();
/*View Last Hit Busyo*/
//Get History
string gacyaHst = PlayerPrefs.GetString("gacyaHst");
if (gacyaHst != null && gacyaHst != "") {
//View History
char[] delimiterChars = {','};
string[] tokens = gacyaHst.Split(delimiterChars);
int[] hitBusyo = Array.ConvertAll<string, int>(tokens, int.Parse);
Gacya viewBusyo = new Gacya();
viewBusyo.viewBusyo(hitBusyo);
} else {
//View Message for only 1st time
Message msg = new Message();
string Text = "登用可能な武将はおりませぬ。\nガチャを回してくだされ。";
msg.makeMessage(Text);
GameObject messageObj = GameObject.Find ("MessageObject");
messageObj.transform.SetParent(GameObject.Find ("CenterView").transform);
RectTransform messageTransform = messageObj.GetComponent<RectTransform> ();
messageTransform.anchoredPosition = new Vector3 (0, 0, 0);
messageObj.GetComponent<FadeuGUI>().enabled = false;
}
}
示例5: Start
// Use this for initialization
void Start () {
int busyoDama = PlayerPrefs.GetInt("busyoDama");
GameObject.Find ("BusyoDamaValue").GetComponent<Text> ().text = busyoDama.ToString();
/*Free Gacya Count*/
freeGacyaTimeString = PlayerPrefs.GetString ("freeGacyaDate");
if (freeGacyaTimeString == null || freeGacyaTimeString == "") {
freeGacyaTimeString = System.DateTime.Today.ToString ();
PlayerPrefs.SetString ("freeGacyaDate",freeGacyaTimeString);
PlayerPrefs.Flush();
}
System.DateTime loginTime = System.DateTime.Parse (freeGacyaTimeString);
System.TimeSpan span = System.DateTime.Today - loginTime;
double spanDay = span.TotalDays;
if (spanDay >= 1) {
//Reset
PlayerPrefs.SetInt ("freeGacyaCounter",0);
PlayerPrefs.Flush();
freeGacyaCount = 0;
}else{
//Get Counted No
freeGacyaCount = PlayerPrefs.GetInt ("freeGacyaCounter");
}
int remain = 10 - freeGacyaCount;
GameObject.Find("Count").GetComponent<Text>().text = remain.ToString();
/*View Last Hit Busyo*/
//Get History
string gacyaHst = PlayerPrefs.GetString("gacyaHst");
if (gacyaHst != null && gacyaHst != "") {
//View History
char[] delimiterChars = {','};
string[] tokens = gacyaHst.Split(delimiterChars);
int[] hitBusyo = Array.ConvertAll<string, int>(tokens, int.Parse);
Gacya viewBusyo = new Gacya();
viewBusyo.viewBusyo(hitBusyo);
} else {
//View Message for only 1st time
Message msg = new Message();
string Text = "登用可能な武将はおりませぬ。\nガチャを回してくだされ。";
msg.makeMessage(Text);
GameObject messageObj = GameObject.Find ("MessageObject");
messageObj.transform.SetParent(GameObject.Find ("CenterView").transform);
RectTransform messageTransform = messageObj.GetComponent<RectTransform> ();
messageTransform.anchoredPosition = new Vector3 (0, 0, 0);
messageObj.GetComponent<FadeuGUI>().enabled = false;
}
}
示例6: OnClick
public void OnClick(){
if (name == "YesButton") {
Message msg = new Message ();
//check
int busyoDama = PlayerPrefs.GetInt ("busyoDama");
if (busyoDama >= 100) {
int newHyourou = 100;
GameObject.Find ("HyourouCurrentValue").GetComponent<Text> ().text = newHyourou.ToString ();
int newBusyoDama = busyoDama - 100;
GameObject.Find ("BusyoDamaValue").GetComponent<Text> ().text = newBusyoDama.ToString ();
PlayerPrefs.SetInt ("busyoDama",newBusyoDama);
PlayerPrefs.SetInt ("hyourou",newHyourou);
MainStageController mainScript = GameObject.Find ("GameController").GetComponent<MainStageController> ();
mainScript.hyourouFull = true;
mainScript.nowHyourou = 100;
mainScript.timer = 300;
GameObject.Find ("TimerValue").GetComponent<Text> ().text = "300";
PlayerPrefs.Flush ();
msg.makeMessage ("武将珠を使用し、兵糧を全回復しましたぞ。");
} else {
msg.makeMessage ("御屋形様、武将珠が不足しておりますぞ。");
}
}
touchBackObj.GetComponent<CloseOneBoard> ().OnClick ();
}
示例7: OnClick
// Use this for initialization
public void OnClick () {
string busyoName = GameObject.Find ("GameScene").GetComponent<NowOnBusyo>().OnBusyoName;
string busyoId = GameObject.Find ("GameScene").GetComponent<NowOnBusyo>().OnBusyo;
int daimyoBusyoId = PlayerPrefs.GetInt ("myDaimyoBusyo");
if (busyoId == daimyoBusyoId.ToString ()) {
Message msgNoBtn = new Message();
string text = "御屋形様、ご自身を追放されるとは\tどういうおつもりですか。";
msgNoBtn.makeMessage(text);
} else {
//Common Process
//Back Cover
string backPath = "Prefabs/Busyo/back";
GameObject back = Instantiate (Resources.Load (backPath)) as GameObject;
back.transform.SetParent(GameObject.Find ("Panel").transform);
back.transform.localScale = new Vector2 (1, 1);
RectTransform backTransform = back.GetComponent<RectTransform> ();
backTransform.anchoredPosition3D = new Vector3 (0, 0, 0);
//Message Box
string msgPath = "Prefabs/Busyo/TsuihouConfirm";
GameObject msg = Instantiate (Resources.Load (msgPath)) as GameObject;
msg.transform.SetParent(GameObject.Find ("Panel").transform);
msg.transform.localScale = new Vector2 (1, 1);
RectTransform msgTransform = msg.GetComponent<RectTransform> ();
msgTransform.anchoredPosition3D = new Vector3 (0, 0, 0);
msgTransform.name = "TsuihouConfirm";
GameObject msgObj = GameObject.Find ("TsuihouText");
string msgText = msgObj.GetComponent<Text> ().text;
//Message Text Mod
msgText = msgText.Replace ("A", busyoName);
msgObj.GetComponent<Text> ().text = msgText;
//Add busyoId
GameObject.Find ("YesButton").GetComponent<DoTsuihou> ().busyoId = int.Parse (busyoId);
GameObject.Find ("YesButton").GetComponent<DoTsuihou> ().busyoName = busyoName;
GameObject.Find ("NoButton").GetComponent<DoTsuihou> ().busyoId = int.Parse (busyoId);
}
}
示例8: OnClick
public void OnClick () {
if (name == "YesButton") {
//Kainin
//Delete Key
if (Application.loadedLevelName == "naisei") {
kuniId = GameObject.Find ("NaiseiController").GetComponent<NaiseiController> ().activeKuniId;
}
string temp = "jyosyu" + kuniId;
int busyoId = PlayerPrefs.GetInt (temp);
PlayerPrefs.DeleteKey(temp);
//JyosyuHei Kainin
string temp2 = "jyosyuHei" + busyoId;
PlayerPrefs.DeleteKey(temp2);
string temp3 = "jyosyuBusyo" + busyoId;
PlayerPrefs.DeleteKey(temp3);
PlayerPrefs.Flush ();
//Close
GameObject.Find ("TouchBack").GetComponent<CloseBoard>().onClick();
//Initialization
//Message
Message msg = new Message();
string text = "城主を解任致しました。";
msg.makeMessage(text);
//Initialization
if (Application.loadedLevelName == "naisei") {
NaiseiController naisei = new NaiseiController ();
naisei.Start ();
}else if(Application.loadedLevelName == "busyo"){
SyoguScene syogu = new SyoguScene();
syogu.createSyoguView(busyoId.ToString());
}
}else if(name == "NoButton"){
//Close
GameObject.Find ("TouchBack").GetComponent<CloseBoard>().onClick();
}
}
示例9: OnClick
public void OnClick(){
int[] hitBusyo = new int[3];
//Reset Touyou Hist
PlayerPrefs.DeleteKey("touyouHst");
PlayerPrefs.Flush ();
//Check
Message msg = new Message();
if(name == "DailyGacyaButton"){
TouyouController script = GameObject.Find("TouyouController").GetComponent<TouyouController>();
int freeGacyaCount = script.freeGacyaCount;
if(freeGacyaCount<10){
//Reduce
int countUp = freeGacyaCount + 1;
int remain = 10 - countUp;
script.freeGacyaCount = countUp;
GameObject.Find("Count").GetComponent<Text>().text = remain.ToString();
//Data
PlayerPrefs.SetString("freeGacyaDate", System.DateTime.Today.ToString ());
PlayerPrefs.SetInt("freeGacyaCounter", countUp);
PlayerPrefs.Flush();
//Gacya
viewBusyo (doGacya ());
}else{
string Text = "本日の無料ガチャは使い切りましたぞ。";
msg.makeMessage(Text);
}
}else if(name == "BusyoDamaGacyaButton"){
//BusyoDama Qty Check
//Reduce Qty
//Gacya
viewBusyo (doGacya ());
}
}
示例10: OnClick
public void OnClick(){
List<string> avlNaiseiList = new List<string> ();
char[] delimiterChars = {':'};
NaiseiController script = GameObject.Find ("NaiseiController").GetComponent<NaiseiController> ();
string shigen = script.shigen;
if(shigen != "null"){
if(shigen.Contains(":")){
avlNaiseiList = new List<string> (shigen.Split (delimiterChars));
}else{
avlNaiseiList.Add(shigen);
}
}
if (avlNaiseiList.Contains ("tp") && avlNaiseiList.Contains ("kb") && avlNaiseiList.Contains ("snb")) {
Message msg = new Message();
msg.makeMessage("この国に鉄砲、騎馬、忍技術は伝達済みです。");
} else {
BusyoStatusButton pop = new BusyoStatusButton ();
pop.commonPopup ();
GameObject.Find ("popText").GetComponent<Text> ().text = "技術伝達";
}
}
示例11: OnClick
public void OnClick(){
if (name == "DoKahouButton") {
reduceActionQty ();
int money = PlayerPrefs.GetInt ("money");
int paiedMoney = int.Parse (Money.GetComponent<Text> ().text);
Message msg = new Message ();
Kahou kahou = new Kahou ();
if (paiedMoney <= money) {
//reduce money
int calc = money - paiedMoney;
PlayerPrefs.SetInt ("money", calc);
PlayerPrefs.Flush ();
GameObject.Find ("MoneyValue").GetComponent<Text> ().text = calc.ToString ();
if (kahouCd == "bugu") {
kahou.registerBugu (kahouId);
} else if (kahouCd == "gusoku") {
kahou.registerGusoku (kahouId);
} else if (kahouCd == "kabuto") {
kahou.registerKabuto (kahouId);
} else if (kahouCd == "meiba") {
kahou.registerMeiba (kahouId);
} else if (kahouCd == "cyadougu") {
kahou.registerCyadougu (kahouId);
} else if (kahouCd == "chishikisyo") {
kahou.registerChishikisyo (kahouId);
} else if (kahouCd == "heihousyo") {
kahou.registerHeihousyo (kahouId);
}
msg.makeMessage ("御屋形様、家宝を手に入れましたぞ。");
//Close
GameObject.Find ("MenuKahou").transform.FindChild ("Close").GetComponent<CloseMenu> ().OnClick ();
Color enableImageColor = new Color (35f / 255f, 35f / 255f, 35f / 255f, 155f / 255f);
Color enableTextColor = new Color (125f / 255f, 125f / 255f, 125f / 255f, 255f / 255f);
GameObject btn = GameObject.Find ("SyouninBoard").transform.FindChild ("Kahou").gameObject;
btn.GetComponent<Button> ().enabled = false;
btn.GetComponent<Image> ().color = enableImageColor;
btn.transform.FindChild ("Text").GetComponent<Text> ().color = enableTextColor;
} else {
msg.makeMessage ("御屋形様、金が不足しておりますぞ。");
}
} else if (name == "DoBusshiButton") {
reduceActionQty ();
int money = PlayerPrefs.GetInt ("money");
int paiedMoney = int.Parse (Money.GetComponent<Text> ().text);
Message msg = new Message ();
if (paiedMoney <= money) {
//reduce money
int calc = money - paiedMoney;
PlayerPrefs.SetInt ("money", calc);
PlayerPrefs.Flush ();
GameObject.Find ("MoneyValue").GetComponent<Text> ().text = calc.ToString ();
char[] delimiterChars = {','};
if (busshiCd.Contains ("Cyouhei") == true) {
if (busshiCd.Contains ("YR") == true) {
string cyouheiYRString = PlayerPrefs.GetString ("cyouheiYR");
string[] cyouheiYR_list = cyouheiYRString.Split (delimiterChars);
string newCyouheiYRString = "";
if (busshiCd == "CyouheiYR1") {
int newQty = 0;
newQty = int.Parse (cyouheiYR_list [0]) + busshiQty;
newCyouheiYRString = newQty.ToString () + "," + cyouheiYR_list [1] + "," + cyouheiYR_list [2];
} else if (busshiCd == "CyouheiYR2") {
int newQty = 0;
newQty = int.Parse (cyouheiYR_list [1]) + busshiQty;
newCyouheiYRString = cyouheiYR_list [0] + "," + newQty.ToString () + "," + cyouheiYR_list [2];
} else if (busshiCd == "CyouheiYR3") {
int newQty = 0;
newQty = int.Parse (cyouheiYR_list [2]) + busshiQty;
newCyouheiYRString = cyouheiYR_list [0] + "," + cyouheiYR_list [1] + "," + newQty.ToString ();
}
PlayerPrefs.SetString ("cyouheiYR", newCyouheiYRString);
} else if (busshiCd.Contains ("KB") == true) {
string cyouheiKBString = PlayerPrefs.GetString ("cyouheiKB");
string[] cyouheiKB_list = cyouheiKBString.Split (delimiterChars);
//.........这里部分代码省略.........
示例12: OnClick
public void OnClick()
{
if (name == "YesButton") {
/*Tsuihou*/
//Limit Check
int myBusyoQty = PlayerPrefs.GetInt("myBusyoQty");
if (myBusyoQty == 1) {
//Error
Message msg = new Message();
string Text = "御館様、武将を皆追放することは出来ませぬぞ。お家を滅ぼすおつもりか。";
msg.makeMessage (Text);
} else {
//Delete Data
//myBusyo
List<string> myBusyo_list = new List<string> ();
string myBusyoString = PlayerPrefs.GetString ("myBusyo");
char[] delimiterChars = {','};
myBusyo_list.AddRange (myBusyoString.Split (delimiterChars));
myBusyo_list.Remove(busyoId.ToString());
string newMyBusyoString = "";
string newOnBusyo = myBusyo_list[0];
for(int i=0; i<myBusyo_list.Count;i++){
newMyBusyoString = newMyBusyoString + myBusyo_list[i] + ",";
}
newMyBusyoString = newMyBusyoString.TrimEnd(',');
//kahou
List<string> kahou_list = new List<string> ();
string kahou = "kahou" + busyoId;
string kahouString = PlayerPrefs.GetString (kahou);
kahou_list.AddRange(kahouString.Split (delimiterChars));
string availableBugu = PlayerPrefs.GetString ("availableBugu");
string availableKabuto = PlayerPrefs.GetString ("availableKabuto");
string availableGusoku = PlayerPrefs.GetString ("availableGusoku");
string availableMeiba = PlayerPrefs.GetString ("availableMeiba");
string availableCyadougu = PlayerPrefs.GetString ("availableCyadougu");
string availableHeihousyo = PlayerPrefs.GetString ("availableHeihousyo");
string availableChishikisyo = PlayerPrefs.GetString ("availableChishikisyo");
for(int j=0; j<kahou_list.Count;j++){
string kahouId = kahou_list[j];
if(j==0){
//Bugu
if(kahouId !="0"){
if(availableBugu != "" && availableBugu != null){
availableBugu = availableBugu + "," + kahouId;
}else{
availableBugu = kahouId;
}
}
}else if(j==1){
//Kabuto
if(kahouId !="0"){
if(availableKabuto != "" && availableKabuto != null){
availableKabuto = availableKabuto + "," + kahouId;
}else{
availableKabuto = kahouId;
}
}
}else if(j==2){
//Gusoku
if(kahouId !="0"){
if(availableGusoku != "" && availableGusoku != null){
availableGusoku = availableGusoku + "," + kahouId;
}else{
availableGusoku = kahouId;
}
}
}else if(j==3){
//Meiba
if(kahouId !="0"){
if(availableMeiba != "" && availableMeiba != null){
availableMeiba = availableMeiba + "," + kahouId;
}else{
availableMeiba = kahouId;
}
}
}else if(j==4){
//Cyadougu1
if(kahouId !="0"){
if(availableCyadougu != "" && availableCyadougu != null){
availableCyadougu = availableCyadougu + "," + kahouId;
}else{
availableCyadougu = kahouId;
}
}
}else if(j==5){
//Cyadougu2
if(kahouId !="0"){
//.........这里部分代码省略.........
示例13: OnDrop
public void OnDrop(PointerEventData eventData)
{
//From JinkeiView to ScrollView
string path = "Prefabs/Jinkei/Slot";
bool limitFlg = true;
if (DragHandler.itemBeginDragged != null) {
if (DragHandler.itemBeginDragged.transform.parent != null) {
if (DragHandler.itemBeginDragged.transform.parent.name != "Slot") {
if (transform.name == "ScrollView" || transform.name == "Slot") {
//Drag JinkeiView -> Scroll
GameObject prefab = Instantiate (Resources.Load (path)) as GameObject;
prefab.transform.parent = GameObject.Find ("Content").transform;
prefab.transform.localScale = new Vector3 (1, 1, 1);
prefab.name = "Slot";
DragHandler.itemBeginDragged.transform.SetParent(prefab.transform);
//Add Busyo Qty
Text busyoQtyObj = GameObject.Find ("jinkeiQtyValue").GetComponent<Text>();
int busyoQty = int.Parse(busyoQtyObj.text);
busyoQtyObj.text = (busyoQty - 1).ToString();
//Add Busyo Status
Text hpObj = GameObject.Find ("totalHpValue").GetComponent<Text> ();
Text atkObj = GameObject.Find ("totalAtkValue").GetComponent<Text> ();
Text dfcObj = GameObject.Find ("totalDfcValue").GetComponent<Text> ();
hpObj.text = (int.Parse(hpObj.text) - DragHandler.itemBeginDragged.GetComponent<Senryoku>().totalHp).ToString();
atkObj.text = (int.Parse(atkObj.text) - DragHandler.itemBeginDragged.GetComponent<Senryoku>().totalAtk).ToString();
dfcObj.text = (int.Parse(dfcObj.text) - DragHandler.itemBeginDragged.GetComponent<Senryoku>().totalDfc).ToString();
}
}else if(DragHandler.itemBeginDragged.transform.parent.name == "Slot"){
if(transform.name != "ScrollView" && transform.name !="Slot"){
//Drag Scroll -> JinkeiView
if(busyoLimitFlg !=0){
if (!item) {
GameObject.Find ("jinkeiQtyValue").GetComponent<Text>().text = busyoLimitFlg.ToString();
//Add Busyo Status
Text hpObj = GameObject.Find ("totalHpValue").GetComponent<Text> ();
Text atkObj = GameObject.Find ("totalAtkValue").GetComponent<Text> ();
Text dfcObj = GameObject.Find ("totalDfcValue").GetComponent<Text> ();
hpObj.text = (int.Parse(hpObj.text) + DragHandler.itemBeginDragged.GetComponent<Senryoku>().totalHp).ToString();
atkObj.text = (int.Parse(atkObj.text) + DragHandler.itemBeginDragged.GetComponent<Senryoku>().totalAtk).ToString();
dfcObj.text = (int.Parse(dfcObj.text) + DragHandler.itemBeginDragged.GetComponent<Senryoku>().totalDfc).ToString();
}else{
Debug.Log ("NOOOOOO");
}
}else{
limitFlg = false;
string Text = "出陣可能数を超えておりますぞ。国力を上げてくだされ。";
Message msg = new Message();
msg.makeMessage (Text);
}
}
}
}
if (!item) {
if(limitFlg != false){
DragHandler.itemBeginDragged.transform.SetParent (transform);
ExecuteEvents.ExecuteHierarchy<IHasChanged> (gameObject, null, (x,y) => x.HasChanged ());
}
} else {
Debug.Log ("busyo exist");
}
}
}
示例14: OnClick
public void OnClick(){
Message msg = new Message();
Gaikou gaikou = new Gaikou ();
int nowHyourou = PlayerPrefs.GetInt ("hyourou");
CloseBoard closeScript = GameObject.Find ("close").GetComponent<CloseBoard> ();
int daimyoBusyoAtk = closeScript.daimyoBusyoAtk;
int daimyoBusyoDfc = closeScript.daimyoBusyoDfc;
int daimyoId = closeScript.daimyoId;
int kuniId = closeScript.kuniId;
if(nowHyourou >= 5){
if (name == "DoGihouBtn") {
//Reduce Hyourou
reduceHyourou ();
//Reduce Shinobi
//Ratio
//Ge 5-15%, Cyu 15-30%, Jyo 30-50%
int randomPercent = 0;
int newQty = itemQty - 1;
if(itemRank == "Ge"){
randomPercent = UnityEngine.Random.Range(5,15);
PlayerPrefs.SetInt ("shinobiGe",newQty);
}else if(itemRank == "Cyu"){
randomPercent = UnityEngine.Random.Range(15,30);
PlayerPrefs.SetInt ("shinobiCyu",newQty);
}else if(itemRank == "Jyo"){
randomPercent = UnityEngine.Random.Range(30,50);
PlayerPrefs.SetInt ("shinobiJyo",newQty);
}
float ratio = (float)randomPercent;
float percent = Random.value;
percent = percent * 100;
if(percent <= ratio){
//OK
//Delete Gunzei
Destroy(Gunzei);
//Delete Key
string gunzeiKey = Gunzei.name;
PlayerPrefs.DeleteKey(gunzeiKey);
//Delete Key History
char[] delimiterChars = {','};
string keyHistory = PlayerPrefs.GetString ("keyHistory");
List<string> keyHistoryList = new List<string>();
if (keyHistory != null && keyHistory != "") {
if(keyHistory.Contains(",")){
keyHistoryList = new List<string> (keyHistory.Split (delimiterChars));
}else{
keyHistoryList.Add(keyHistory);
}
}
keyHistoryList.Remove(gunzeiKey);
string newKeyHistory = "";
for(int i=0; i<keyHistoryList.Count; i++){
if(i==0){
newKeyHistory = keyHistoryList[i];
}else{
newKeyHistory = newKeyHistory + "," + keyHistoryList[i];
}
}
PlayerPrefs.SetString("keyHistory",newKeyHistory);
//Message
string daimyoName = Gunzei.GetComponent<Gunzei>().srcDaimyoName;
string OKtext = "御屋形様、偽報に成功しましたぞ。\t " + daimyoName + "の軍勢が退却します。";
msg.makeMessage (OKtext);
}else{
//NG
int nowYukoudo = gaikou.getMyGaikou(daimyoId);
int newYukoudo = gaikou.downMyGaikou(daimyoId,nowYukoudo,maxReduceValue);
int reduceYukoudo = nowYukoudo - newYukoudo;
GameObject.Find ("YukouValue").GetComponent<Text> ().text = newYukoudo.ToString ();
//Message
string NGtext = "申し訳御座りませぬ。偽報に失敗しましたぞ。\t友好度が" + reduceYukoudo + "下がりますぞ。";
msg.makeMessage (NGtext);
}
PlayerPrefs.Flush();
//Back
GameObject.Find ("return").GetComponent<MenuReturn> ().OnClick ();
}else if(name == "DoRyugenBtn"){
//Reduce Hyourou
reduceHyourou ();
//Ratio
//Ge 10-20%, Cyu 20-40%, Jyo 40-70%
//.........这里部分代码省略.........
示例15: registerKanni
public bool registerKanni(int kanniRatio, int kanniId, string kanniName){
float ratio = (float)kanniRatio;
float percent = Random.value;
percent = percent * 100;
bool successFlg = false;
//Kanni
Message msg = new Message ();
if(percent <= ratio){
//OK
successFlg = true;
string myKanni = PlayerPrefs.GetString ("myKanni");
if(myKanni != null && myKanni !=""){
myKanni = myKanni + "," + kanniId.ToString();
}else{
myKanni = kanniId.ToString();
}
PlayerPrefs.SetString ("myKanni",myKanni);
//Message
string OKtext = "祝着至極に存じます。\t" + kanniName + "が叙位されましたぞ。";
msg.makeMessage (OKtext);
PlayerPrefs.Flush();
string serihu = "そなたの忠勤にはいつも嬉しく思っておる。これからも朕に力を貸しておくれ。";
serihuScript.mikadoSerihuChanger(serihu);
}else{
//NG
//Message
string NGtext = "残念に御座りまする。\t任官なりませんでした。";
msg.makeMessage (NGtext);
string serihu = "そなたの忠勤には感謝しておるが、今は都合悪く叙任できぬのう。";
serihuScript.mikadoSerihuChanger(serihu);
}
return successFlg;
}