void Start() { if (photonView.IsMine == false) { Lap_Time = GameObject.Find("LapTime").GetComponent <TimeCount>(); } }
private void Start() { image = GetComponent <Image>(); rect = GetComponent <RectTransform>(); timeCount = GameObject.Find("Canvas/Time").GetComponent <TimeCount>(); StartCoroutine(ReadyGo()); }
// Update is called once per frame void Update() { GameObject TIME = GameObject.FindGameObjectWithTag("Time"); TimeCount TMC = TIME.GetComponent <TimeCount>(); if (Input.GetKeyDown(KeyCode.Space)) { Anim.SetInteger("Status", 3); } else if (Input.GetKeyUp(KeyCode.Space)) { Anim.SetInteger("Status", 1); } else if (TMC.timer == 0) { Anim.SetInteger("Status", 0); } else if (Input.GetKey(KeyCode.D)) { Anim.SetInteger("Status", 2); } else if (Input.GetKeyUp(KeyCode.D)) { Anim.SetInteger("Status", 1); } else if (Input.GetKey(KeyCode.A)) { Anim.SetInteger("Status", 2); } else if (Input.GetKeyUp(KeyCode.A)) { Anim.SetInteger("Status", 1); } }
//check for automatic initialization void Start() { IgnoreCheck = false; isCol = false; WayPointUpdate = false; start_fspeed = speed; repeat_count = 0; Player_fCol_count = 2.0f; Item_CulTime = 0.0f; Item_Time = 0.0f; Start_Number = GameObject.Find("StartCount"); Start_Count = GameObject.Find("StartCount").GetComponent <StartCount>(); Time_Count = GameObject.Find("LapTime").GetComponent <TimeCount>(); Player_Ani = GameObject.Find("avatar1").GetComponent <Animator>(); Speed1Item_Effet = GameObject.Find("Item(Speed1)").GetComponent <ItemEffet>(); Speed2Item_Effet = GameObject.Find("Item(Speed2)").GetComponent <ItemEffet>(); IgnoreItem_Effet = GameObject.Find("Item(Ignore)").GetComponent <ItemEffet>(); //Speed1Item_Effet = FindObjectOfType<Item_Box>(); //Speed2Item_Effet = FindObjectOfType<Item_Box>(); //IgnoreItem_Effet = FindObjectOfType<Item_Box>(); //StartCoroutine(SpeedUpItem()); //StartCoroutine(SpeedUpItem(0)); //StartCoroutine(IgnoreItem()); }
private string _activeStageName; // 現在のステージ名 // Start is called before the first frame update void Start() { Debug.Log("TimeAttackStart"); _activeStageName = SceneManager.GetActiveScene().name; FindInfoByScene.Instance.EntryPlayerName(); int lapMax = FindInfoByScene.Instance.GetLapMax(_activeStageName); Debug.Log("lapMax:" + lapMax); GameObject[] racingCars = GameObject.FindGameObjectsWithTag("RacingCar"); for (int idx = 0; idx < FindInfoByScene.Instance.GetPlayerNum; idx++) { racingCars[idx].GetComponent <LapCount>().SetUp(); racingCars[idx].GetComponent <CheckPointCount>().SetUp(); } timeRanking = timeRanking.GetComponent <TimeRanking>(); // 第一引数をコース名にする timeRanking.SetUpTimeRanking(_activeStageName, 6, lapMax); dispRanking = dispRanking.GetComponent <DispRanking>(); goalFlag = goalFlag.GetComponent <GoalFlag>(); timeCounter = timeCounter.GetComponent <TimeCount>(); startCounter = startCounter.GetComponent <StartStopController>(); }
static void Main(string[] args) { var timer = new TimeCount(); while (true) { Console.WriteLine(" 's' to start\n 'f' to finish\n 'q' to quit"); var input = Console.ReadLine(); if (input == "s") { timer.Start(); Console.WriteLine("Timer has started"); } else if (input == "f") { var result = timer.Stop(DateTime.Now); Console.WriteLine("Time spend: " + result); continue; } else if (input == "q") { break; } else { Console.WriteLine("Only 's', 'f' and 'q' are available"); } } }
void Awake() { if (PhotonNetwork.LocalPlayer.NickName == "Player_1") { GameObject User = PhotonNetwork.Instantiate("Player1", UserGroup.transform.localPosition, Quaternion.identity); User.transform.parent = UserGroup.transform; My_Time = GameObject.Find("Text_Player1Time").GetComponent <Text>(); OtherUser_Time = GameObject.Find("Text_Player2Time").GetComponent <Text>(); GameObject EndTrig = PhotonNetwork.Instantiate("EndTrigger", SysObj.transform.localPosition, Quaternion.identity); EndTrig.transform.parent = SysObj.transform; } else if (PhotonNetwork.LocalPlayer.NickName == "Player_2") { GameObject User = PhotonNetwork.Instantiate("Player2", UserGroup.transform.localPosition, Quaternion.identity); User.transform.parent = UserGroup.transform; My_Time = GameObject.Find("Text_Player2Time").GetComponent <Text>(); OtherUser_Time = GameObject.Find("Text_Player1Time").GetComponent <Text>(); GameObject EndTrig = PhotonNetwork.Instantiate("EndTrigger", SysObj.transform.localPosition, Quaternion.identity); EndTrig.transform.parent = SysObj.transform; } PhotonNetwork.IsMessageQueueRunning = true; Lap_Time = GameObject.Find("LapTime").GetComponent <TimeCount>(); }
static void Save(Importer importer) { using (TimeCount.Start("Saving meshes")) { foreach (var mesh in importer.Meshes) { MeshUtility.Optimize(mesh); string meshPath = string.Format("{0}/{1}/meshes/{2}.prefab", Paths.AssetArtworks, importer.Name, mesh.name); AssetDatabase.CreateAsset(mesh, meshPath); } } if (null != importer.Material) { using (TimeCount.Start("Saving material")) { string parent = string.Format("{0}/{1}", Paths.AssetArtworks, importer.Name); AssetDatabase.CreateFolder(parent, "materials"); string matPath = string.Format("{0}/{1}/materials/{2}.mat", Paths.AssetArtworks, importer.Name, importer.Material.name); AssetDatabase.CreateAsset(importer.Material, matPath); } } using (TimeCount.Start("Saving prefab")) { string prefabPath = string.Format("{0}/{1}/{1}.prefab", Paths.AssetResArtworks, importer.Name); UnityEngine.Object prefab = PrefabUtility.CreatePrefab(prefabPath, importer.GameObject); PrefabUtility.ReplacePrefab(importer.GameObject, prefab, ReplacePrefabOptions.ConnectToPrefab); } using (TimeCount.Start("Saving assets")) AssetDatabase.SaveAssets(); }
void Start() { EndWindow = GameObject.Find("EndWindow"); LapTime = GameObject.Find("LapTime").GetComponent <TimeCount>(); Player_animator = Player.GetComponent <Animator>(); EndWindow.SetActive(false); }
void Start() { timeCount = GameObject.Find("Map").GetComponent <TimeCount> (); timePoint = Random.Range(50f, 100f); thisSpriteRend = this.GetComponent <SpriteRenderer> (); isDead = false; transformPosition = new Vector2(this.transform.position.x, this.transform.position.y); }
public void Import(Preprocess.ImporterArgs args) { useVertColor = args.useVertColor; TimeCount.Measure(ReadConfig); TimeCount.Measure(GenerateTriangles); TimeCount.Measure(GenerateMesh); TimeCount.Measure(GenerateMaterial); }
void Start() { timeCount = GetComponent <TimeCount>();//获取TimeCount //button.enabled = false; bu.GetComponent <CanvasGroup>().alpha = 0; bu.GetComponent <CanvasGroup>().interactable = false; bu.GetComponent <CanvasGroup>().blocksRaycasts = false; }
static void ProcessAfterImport(PolyGraph graph) { using (TimeCount.Start("Resolve Regions")) RegionResolver.Resolve(graph); using (TimeCount.Start("Create Wireframe")) WireframeCreator.Create(graph); using (TimeCount.Start("Saving initial snapshot")) Others.SaveInitialSnapshot(graph); }
private GameManager _gameMg; // ゲームマネージャー // Start is called before the first frame update void Start() { timeCounter = timeCounter.GetComponent <TimeCount>(); parentCp = parentCp.GetComponent <ParentCheckPoint>(); GameObject[] racingCars = GameObject.FindGameObjectsWithTag("RacingCar"); _playerNum = racingCars.Length; _finishCall = new bool[_playerNum]; }
// Start is called before the first frame update void Start() { TimeUse = 0; TimeText.text = "剩余时间:" + TimeLimit.ToString(); Playing = false; if (timecount == null) { timecount = this; } }
void Start() { _timeCount = FindObjectOfType <TimeCount>(); _scoreCompare = FindObjectOfType <ScoreCompare>(); //_regularInterval = _drawTime / _startCountImage.Length; _time = _drawTime; foreach (var image in _startCountImage) { image.enabled = false; } }
// Retrieve Time count settings private TimeCount RetrieveTimeCount() { TimeCount TimeCount = new TimeCount() { Interval = p.GetHRAttribute(ccSR.Update_Interval_Value), Start = p.GetHRAttribute(ccSR.Time_Count_Start_Value), End = p.GetHRAttribute(ccSR.Time_Count_End_Value), ResetTime = p.GetHRAttribute(ccSR.Reset_Time_Value), ResetValue = p.GetHRAttribute(ccSR.Time_Count_Reset_Value), }; return(TimeCount); }
void Start() { if (_timeCount == null) { _timeCount = GameObject.Find("Time").GetComponent<TimeCount>(); } foreach (var image in _startCountImage) { image.enabled = false; } if (_gameManager == null) { Debug.Log("_gameManager が null です。KeyAction スクリプトが入ってるオブジェクトをいれてください。"); } }
void Start() { demogui = Canvas.GetComponent <DemoGUI>(); set = 0; subset = 0; audioSource = this.gameObject.GetComponent <AudioSource>(); audioSource.clip = deside; logS = GetComponent <logSave>(); timeC = GetComponent <TimeCount>(); inputtingNow1 = false; inputtingNow2 = false; /* 機能制限 */ isAutoSetChange = true; }
void Awake() { timeCount = GameObject.Find("Player").GetComponent <TimeCount>(); patternManager = this.gameObject.GetComponent <PatternManager>(); planetColor = this.gameObject.GetComponent <PlanetColor>(); for (int i = 0; i < phase.Length; i++) { phase[i] = false; } planetColor.playTime = 60; StartCoroutine(UpdateByUsingCoroutine()); }
void Awake() { timeCount = GameObject.Find("Player").GetComponent <TimeCount>(); rend = GetComponentsInChildren <Renderer>(); baseColor = rend[0].material.color; r = baseColor.r / playTime; g = baseColor.g / playTime; b = baseColor.b / playTime; for (int i = 0; i < rend.Length; i++) { rend[i].material.color = new Color(baseR, baseG, baseB); } }
// Retrieve Time count settings private TimeCount RetrieveTimeCount() { XMLwriter.WriteStartElement("TimeCount"); TimeCount TimeCount = new TimeCount() { Interval = p.GetHRAttribute(ccSR.Update_Interval_Value), Start = p.GetHRAttribute(ccSR.Time_Count_Start_Value), End = p.GetHRAttribute(ccSR.Time_Count_End_Value), ResetTime = p.GetHRAttribute(ccSR.Reset_Time_Value), ResetValue = p.GetHRAttribute(ccSR.Time_Count_Reset_Value), }; XMLwriter.WriteEndElement(); return(TimeCount); }
public void showRankList(int stage) { Debug.Log("show rank list: " + stage); //JsonData jd = LoadJson.LoadSavedUserInfo (); var contentAdd = GetComponent <ScrollRect> ().content; // contentAdd.GetComponent<GridLayoutGroup> ().cellSize = new Vector2 (Screen.width / 750.0f * 650.0f, Screen.height / 1334.0f * 100.0f); var list = _rankData ["data"][string.Format("stage_{0}", stage)]; // Debug.Log (_rankData ["data"] [string.Format ("stage_{0}", stage)].IsArray); // return; _userInfo._numindex.text = DataManager._languageIndex == 1 ? "未上榜" : "None"; _userInfo._name.text = PlayerPrefs.GetString("PlayerName"); //jd ["PlayerName"].ToString (); string defaultScore = TimeCount.stringCut((PlayerPrefs.GetFloat(string.Format("Stage_{0}", stage)) / 1000.0f).ToString() + "s"); //((int)(jd[string.Format ("Stage_{0}", stage)]) / 1000.0f).ToString()) _userInfo._score.text = defaultScore.Length == 1 ? "0.000s" : defaultScore; for (int i = 1; i <= list.Count; ++i) { if (list [i - 1] [0].ToString() == _userInfo._name.text) { _userInfo._numindex.text = i.ToString(); _userInfo._score.text = TimeCount.stringCut(((int)(list [i - 1] [1]) / 1000.0f).ToString()) + "s"; } bool addNew = false; GameObject singleRankItem = null; if (contentAdd.childCount == 100) { singleRankItem = contentAdd.GetChild(i - 1).gameObject; } else { addNew = true; singleRankItem = Instantiate(_rankItemPrefab); } var texts = singleRankItem.GetComponent <RankItemScript> (); texts._numindex.text = i.ToString(); texts._name.text = list [i - 1] [0].ToString(); texts._score.text = TimeCount.stringCut(((int)(list [i - 1] [1]) / 1000.0f).ToString()) + "s"; // texts._name.text = list [i - 1] ["name"].ToString(); // texts._score.text = list [i - 1] ["score"].ToString(); //singleRankItem.GetComponent<RectTransform>().sizeDelta = new Vector2 (Screen.width / 750.0f, Screen.height / 1334.0f); //Debug.Log (singleRankItem.GetComponent<RectTransform> ().sizeDelta.x + " , " + singleRankItem.GetComponent<RectTransform> ().sizeDelta.y); if (addNew) { singleRankItem.transform.SetParent(contentAdd.transform, false); } } }
public static void Process(string name, ImporterArgs args) { Debug.LogFormat("--- Preprocess {0} Start ---", name); using (TimeCount.Start("Total")) { Clear(name); CreateFolders(name); using (var importer = CreateImporter(name)) { Debug.Log(importer.GetType().Name); importer.Import(args); var graph = importer.GameObject.GetComponent <PolyGraph>(); SetBackgroundTexture(graph); ProcessAfterImport(graph); Save(importer); } } Debug.LogFormat("--- Preprocess {0} Finished ---", name); }
void Start() { pv = GetComponent <PhotonView>(); pv.ObservedComponents[0] = this; EndState = false; BGM_Mgr = GameObject.Find("BGM_Manager"); LapTime = GameObject.Find("LapTime").GetComponent <TimeCount>(); EndWindow = GameObject.Find("Stage1_EndWindow"); if (PhotonNetwork.LocalPlayer.NickName == "Player_1") { Sound_Source.clip = Sound_Arr[0]; Player_animator = GameObject.Find("avatar1").GetComponent <Animator>(); } else if (PhotonNetwork.LocalPlayer.NickName == "Player_2") { Sound_Source.clip = Sound_Arr[1]; Player_animator = GameObject.Find("avatar2").GetComponent <Animator>(); } EndWindow.SetActive(false); }
void Start() { //_player = _keyAction.GetPlayers(); if (_audioPlayer == null) { _audioPlayer = GameObject.Find("AudioPlayer").GetComponent <AudioPlayer>(); } if (_startCount == null) { _startCount = GameObject.Find("StartCount").GetComponent <StartCount>(); } if (_timeCount == null) { _timeCount = GameObject.Find("Time").GetComponent <TimeCount>(); } _randomBullet = GetComponent <RandomBullet>(); _characterData = GetComponentInChildren <CharacterData>(); }
// Use this for initialization void Start() { m_readyFlag = new bool[4]; m_animePlayer = new Animator[4]; for (int i = 0; i < 4; i++) { m_readyFlag[i] = false; //m_animePlayer[i] = GameObject.Find("PlayerCharacter" + (i+1).ToString()).GetComponent<Animator>(); GameObject.Find("PlayerCharacter" + (i + 1).ToString()).GetComponent <Animator>().Play("Base Layer.Movable.Move"); } flg = false; // 時間をスタート m_timeCountScript = GameObject.Find("Time").GetComponent <TimeCount>(); //m_timeCountScript.StartTime(); se026_startFlag = new bool[4]; for (int i = 0; i < 4; i++) { se026_startFlag[i] = false; } }
/// <summary> /// 尝试多次机器人写坐标,直到成功或用完次数。 /// </summary> /// <param name="rollPos"></param> /// <param name="times"></param> /// <returns></returns> public bool TryWritePositionPro(RollPosition rollPos, int times = 5) { const int DELAY = 100; var counts = 0; var wstatus = false; var t = TimeCount.TimeIt(() => { while (times > 0) { counts++; wstatus = WritePositionPro(rollPos); if (wstatus) { break; } times--; Thread.Sleep(DELAY); } }); log($"机器人写坐标{(wstatus ? "成功" : "失败")}耗时{t}毫秒,尝试次数{counts}, {rollPos.LabelCode}, {rollPos.Pos_s()} ChangeAngle {rollPos.ChangeAngle}。", LogType.ROBOT_STACK); return(wstatus); }
//check for automatic initialization void Start() { IgnoreCheck = false; isCol = false; WayPointUpdate = false; start_fspeed = speed; repeat_count = 0; Item_CulTime = 0.0f; Item_Time = 0.0f; pathContainer = GameObject.Find("PlayerWayPoint1").GetComponent <PathManager>(); Start_Number = GameObject.Find("StartCount"); Start_Count = GameObject.Find("StartCount").GetComponent <StartCount>(); Time_Count = GameObject.Find("LapTime").GetComponent <TimeCount>(); if (PhotonNetwork.LocalPlayer.NickName == "Player_1") { Player_Ani = GameObject.Find("avatar1").GetComponent <Animator>(); } else if (PhotonNetwork.LocalPlayer.NickName == "Player_2") { Player_Ani = GameObject.Find("avatar2").GetComponent <Animator>(); } Speed1Item_Effet = GameObject.FindGameObjectWithTag("Item2").GetComponent <ItemEffet>(); Speed2Item_Effet = GameObject.FindGameObjectWithTag("Item").GetComponent <ItemEffet>(); IgnoreItem_Effet = GameObject.FindGameObjectWithTag("Item1").GetComponent <ItemEffet>(); //Speed1Item_Effet = FindObjectOfType<Item_Box>(); //Speed2Item_Effet = FindObjectOfType<Item_Box>(); //IgnoreItem_Effet = FindObjectOfType<Item_Box>(); //StartCoroutine(SpeedUpItem()); //StartCoroutine(SpeedUpItem(0)); //StartCoroutine(IgnoreItem()); }
void Start() { aud = GetComponent <AudioSource>(); timeCount = GameObject.Find("Canvas/Time").GetComponent <TimeCount>(); StartCoroutine(SceneChange.FadeOut()); map = GameObject.Find("map").transform; isMoving = true; GameObject[] maps = GameObject.FindGameObjectsWithTag("Map"); foreach (GameObject g in maps) { if (g.name.Substring(0, 2) == "m1") { float color = Random.Range(0.7f, 1f); //g.GetComponent<SpriteRenderer>().color = new Color(color, color, color, Random.Range(0.9f, 1f)); } } cameraT = Camera.main.transform; playerT = GameObject.FindGameObjectWithTag("Player").transform; }
// Update is called once per frame void Update() { Vector3 movement = new Vector3(_player.transform.position.x + offsetX, transform.position.y, transform.position.z); transform.position = movement; if (DataManager._isOver && !_iscalled) { //JsonData jd = LoadJson.LoadSavedUserInfo (); if (_winMask != null) { Debug.Log("Call win mask"); _winMask.gameObject.SetActive(true); string tc = TimeCount.stringCut(_timeText._timeCount.ToString()); _winTimeCount.text = "Time\n" + tc + "s"; float lateScore = PlayerPrefs.GetFloat("Stage_" + DataManager._currentStage.ToString()) / 1000.0f; //float lateScore = (int)(jd["Stage_" + DataManager._currentStage.ToString ()]) / 1000.0f; //Debug.Log (lateScore.ToString () + " - " + _timeText._timeCount.ToString ()); if (lateScore == 0.0f || lateScore > _timeText._timeCount) { Debug.Log("try update"); // Dictionary<string,string> dic = new Dictionary<string,string> (); // dic.Add ("stage", DataManager._currentStage.ToString ()); // dic.Add ("time", Mathf.FloorToInt (_timeText._timeCount * 1000.0f).ToString ()); // JsonData data = NetUtil.RequestMsg (NetUtil.MsgUpdateScore, dic); // GetComponent <PlayerManager> ().UpdateScore(DataManager._currentStage.ToString(), Mathf.FloorToInt(_timeText._timeCount * 1000.0f).ToString()); } GetComponent <AudioSource> ().Stop(); //Debug.Log (DataManager._currentStage + " " + PlayerPrefs.GetInt ("PassedStageNum")); if (DataManager._currentStage > PlayerPrefs.GetInt("PassedStageNum")) //PlayerPrefs.GetInt("PassedStageNum") //Debug.Log (DataManager._currentStage + " " + PlayerPrefs.GetInt ("PassedStageNum")); { PlayerPrefs.SetInt("PassedStageNum", PlayerPrefs.GetInt("PassedStageNum") + 1); //jd ["PassedStageNum"] = new JsonData ((int)(jd ["PassedStageNum"]) + 1); DataManager._passedNum += 1; if (DataManager._passedNum > DataManager._stageMaxNum) { DataManager._passedNum = DataManager._stageMaxNum; } } } _iscalled = true; DataManager._needUpdateRank = true; PlayerPrefs.Save(); //LoadJson.SaveUserInfo (jd); return; } if (DataManager._isFailed && !_iscalled) { if (_failedMask != null) { //check rebirth times Debug.Log("Call failed mask"); _failedMask.gameObject.SetActive(true); GetComponent <AudioSource> ().Stop(); } _iscalled = true; DataManager._needUpdateRank = true; return; } if (DataManager._waitForRebirth) { if (!_rebirthMask.gameObject.activeInHierarchy) { _rebirthMask.gameObject.SetActive(true); } return; } if (_player.transform.position.y - transform.position.y < -Screen.height / 200.0f && !DataManager._isFailed) { Debug.Log("out of sight"); _player.GetComponent <PlayerController> ().SetDead(); } }
void Start() { _timeCount = FindObjectOfType<TimeCount>(); _scoreCompare = FindObjectOfType<ScoreCompare>(); //_regularInterval = _drawTime / _startCountImage.Length; _time = _drawTime; foreach (var image in _startCountImage) { image.enabled = false; } }
void Start() { //_player = _keyAction.GetPlayers(); if (_audioPlayer == null) { _audioPlayer = GameObject.Find("AudioPlayer").GetComponent<AudioPlayer>(); } if (_startCount == null) { _startCount = GameObject.Find("StartCount").GetComponent<StartCount>(); } if (_timeCount == null) { _timeCount = GameObject.Find("Time").GetComponent<TimeCount>(); } _randomBullet = GetComponent<RandomBullet>(); _characterData = GetComponentInChildren<CharacterData>(); }