// Use this for initialization void Start() { GET("https://cedec2015.seccon.jp/cedec2015/GameCtrl/"); int my_score = GameRuleCtrl.get_score(); my_score_str = "Your Time: " + my_score.ToString(); playername = TitleSceneCtrl.get_playername(); if (my_score != -1) { playername += GameRuleCtrl.get_gamecookie(); } }
void Start() { // init audio clearSeAudio = gameObject.AddComponent <AudioSource>(); clearSeAudio.loop = false; clearSeAudio.clip = clearSeClip; // for getting status of player player = GameObject.Find("Player"); player_cs = player.GetComponent <CharacterStatus> (); // for getting status of dragon dragon = GameObject.Find("Dragon"); dragon_cs = dragon.GetComponent <CharacterStatus> (); // for change gameGUI to connect/noconnect gameGUI = GameObject.Find("GameGUI"); characterStatusGUI_cs = gameGUI.GetComponent <CharacterStatusGui> (); // set player name from title player_cs.characterName = TitleSceneCtrl.get_playername(); if (player_cs.characterName == "Warrior") { player_cs.Power = 24; } if (player_cs.characterName == "Phoenix") { player_cs.MaxHP = 999; player_cs.HP = 999; } if (player_cs.characterName == "Lunatic") { player_cs.MaxHP = 15; player_cs.HP = 15; player_cs.Power = 5; } // init score timeRemaining_forScoreScene = -1; apkhash = TitleSceneCtrl.get_systemcode(); NetworkFlag = 1; GameCookie = ""; ShareStatus("Start"); }
// キャラクターステータスの描画. void DrawCharacterStatus(CharacterStatus status, Rect bar_rect, Color front_color) { Vector3 a = status.transform.position; a.y += 2; Vector3 pos = ca.WorldToScreenPoint(a); float x = pos.x; float y = ca.pixelHeight - pos.y; if (status.characterName == TitleSceneCtrl.get_playername()) { x -= 140; } else { x += 20; } // 名前. GUI.Label( new Rect(x, y, nameRect.width, nameRect.height), status.characterName, nameLabelStyle); float life_value = (float)status.HP / status.MaxHP; if (backLifeBarTexture != null) { // 背面ライフバー. y += nameRect.height; GUI.DrawTexture(new Rect(x, y, bar_rect.width, bar_rect.height), backLifeBarTexture); } // 前面ライフバー. if (frontLifeBarTexture != null) { float resize_front_bar_offset_x = frontLifeBarOffsetX * bar_rect.width / lifeBarTextureWidth; float front_bar_width = bar_rect.width - resize_front_bar_offset_x * 2; var gui_color = GUI.color; GUI.color = front_color; GUI.DrawTexture(new Rect(x + resize_front_bar_offset_x, y, front_bar_width * life_value, bar_rect.height), frontLifeBarTexture); GUI.color = gui_color; } }