public void MultiShootTes(string mes, Vector3 shotPos, Quaternion shotDir) { //OVRDevice.GetPredictedOrientation(0, ref OVR_angle); GameObject createBlock = Instantiate(this.BlockPrefab, shotPos, shotDir) as GameObject; TextManage textManage = createBlock.GetComponent <TextManage>(); var shootWorldQuat = shotDir; //PlayerObj.transform.rotation; textManage.SendMessage(mes); createBlock.SendMessage("ChangeText", mes); if (Random.Range(0, 3) == 0) { createBlock.SendMessage("ChangeColor", new Color(1.0f, 0.0f, 0.0f)); } createBlock.rigidbody.velocity = shootWorldQuat * new Vector3(0, 5, ShootPow); }
public async Task <IActionResult> Detail(int Id, string returnUrl) { var news = await _dbContext.News.Include(n => n.Detail).SingleAsync(p => p.Id == Id); if (news != null) { if (news.Detail == null) { news.Detail = new NewsDetail(); } news.Detail.ClickCount++; _dbContext.SaveChangesAsync().Wait(); news.Content = TextManage.ToHtml(news.Content); DetailViewModel detailViewModel = new DetailViewModel { News = news }; return(View(detailViewModel)); } return(RedirectToAction("Index")); }
public void ShootMulti(string mes, Vector3 shotPos, Quaternion shotDir, PhotonMessageInfo mi) { string senderName = "anonymous"; if (mi != null && mi.sender != null) { if (!string.IsNullOrEmpty(mi.sender.name)) { senderName = mi.sender.name; } else { senderName = "player " + mi.sender.ID; } } //OVRDevice.GetPredictedOrientation(0, ref OVR_angle); GameObject createBlock = Instantiate(this.BlockPrefab, shotPos, shotDir) as GameObject; TextManage textManage = createBlock.GetComponent <TextManage>(); var shootWorldQuat = shotDir; //PlayerObj.transform.rotation; //textManage.SendMessage(mes); createBlock.SendMessage("ChangeText", mes); if (Random.Range(0, 3) == 0) { createBlock.SendMessage("ChangeColor", new Color(1.0f, 0.0f, 0.0f)); } createBlock.rigidbody.velocity = shootWorldQuat * new Vector3(0, 5, ShootPow); //if(null!=applyFunc) //{ // applyFunc(createBlock); //} // this.gameObject.rigidbody.velocity=new Vector3(ShootPow,0,0); }