public void HeartMouseOut(Heart heart) { if (this.currentState != ClickState.HeartDown) { this.GetHeartAnimator(heart).SetBool("Visible", false); } this.GetHeartAnimator(heart).SetBool("Throbbing", false); }
public void HeartMouseDown(Heart heart) { this.currentState = ClickState.HeartDown; this.clickedHeart = heart; this.overTile = null; this.GetHeartAnimator(heart).SetBool("Clenched", true); }
// Construct the CarpenterActions list. public CarpenterActions() { ResourceLibrary = new ResourceLibrary(Settings.ResourceLocation, ClassJobType.Carpenter); BasicSynthesis = new BasicSynthesis(CraftActionId.crp_BasicSynthesis, ResourceLibrary.ClassSkillImages["crp_BasicSynthesis"]); StandardSynthesis = new StandardSynthesis(CraftActionId.crp_StandardSynthesis, ResourceLibrary.ClassSkillImages["crp_StandardSynthesis"]); BasicTouch = new BasicTouch(CraftActionId.crp_BasicTouch, ResourceLibrary.ClassSkillImages["crp_BasicTouch"]); StandardTouch = new StandardTouch(CraftActionId.crp_StandardTouch, ResourceLibrary.ClassSkillImages["crp_StandardTouch"]); AdvancedTouch = new AdvancedTouch(CraftActionId.crp_AdvancedTouch, ResourceLibrary.ClassSkillImages["crp_AdvancedTouch"]); PreciseTouch = new PreciseTouch(CraftActionId.crp_PreciseTouch, ResourceLibrary.ClassSkillImages["crp_PreciseTouch"]); MastersMend = new MastersMend(CraftActionId.crp_MastersMend); MastersMendII = new MastersMendII(CraftActionId.crp_MastersMendII); SteadyHand = new SteadyHand(CraftActionId.crp_SteadyHand); InnerQuiet = new InnerQuiet(CraftActionId.crp_InnerQuiet); GreatStrides = new GreatStrides(CraftActionId.crp_GreatStrides); Observe = new Observe(CraftActionId.crp_Observe); CollectableSynthesis = new CollectableSynthesis(CraftActionId.crp_CollectableSynthesis); ByregotsBrow = new ByregotsBrow(CraftActionId.crp_ByregotsBrow); InnovativeTouch = new InnovativeTouch(CraftActionId.crp_InnovativeTouch); ByregotsMiracle = new ByregotsMiracle(CraftActionId.crp_ByregotsMiracle); NymeiasWheel = new NymeiasWheel(CraftActionId.crp_NymeiasWheel); TrainedHand = new TrainedHand(CraftActionId.crp_TrainedHand); Satisfaction = new Satisfaction(CraftActionId.crp_Satisfaction); Heart = new Heart(CraftActionId.crp_Heart); WhistleWhileYouWork = new WhistleWhileYouWork(CraftActionId.crp_WhistleWhileYouWork); PHTouch = new PHTouch(CraftActionId.crp_PreciseTouch); }
public void HeartMouseOver(Heart heart) { this.overHeart = heart; this.overTile = null; this.GetHeartAnimator(heart).SetBool("Visible", true); this.GetHeartAnimator(heart).SetBool("Throbbing", true); this.UpdateLey(); }
void Start() { //m_filipState = m_filip.GetComponent<FilipState>(); m_heart1 = transform.GetChild(0).GetComponent<Heart>(); m_heart2 = transform.GetChild(1).GetComponent<Heart>(); m_heart3 = transform.GetChild(2).GetComponent<Heart>(); m_heart4 = transform.GetChild(3).GetComponent<Heart>(); m_heart5 = transform.GetChild(4).GetComponent<Heart>(); }
void OnTriggerEnter(Collider other) { if(other.tag == "Heart"){ heartIsHere=true; heart=other.GetComponent<Heart>(); heart.transform.position=transform.position; //heart.gameObject.renderer.enabled=false; heart.speed=0; heart.gameObject.audio.clip=heart.jumpInSound; heart.gameObject.audio.Play(); } }
public Beast.BeastLink GetFakeHeartLinkPath(Heart heart) { string[] directions = null; switch (heart) { case Heart.Left: directions = new string[]{"left", "left", "left", "left", "left", "left", "left"}; break; case Heart.Right: directions = new string[]{"right", "right", "right", "right", "right", "right", "right"}; break; case Heart.Up: directions = new string[]{"up", "up", "up", "up", "up", "up", "up"}; break; case Heart.Down: directions = new string[]{"down", "down", "down", "down", "down", "down", "down"}; break; } return new Beast.BeastLink(this.GetPlayer(), directions); }
void Victory(Heart heart) { heart.Splat(20); heart.rigidbody.constraints = RigidbodyConstraints.FreezeAll; }
public void HeartMouseUp(Heart heart) { if (this.overTile != null) { this.overTile.link.set(this.GetHeartLink(this.clickedHeart).get()); this.RefreshScreen(); this.GetHeartAnimator(heart).SetBool("Visible", false); this.PulseHeart(heart); } if (this.overHeart != Heart.None) { if (this.overHeart == this.clickedHeart) { this.GetPlayer().inner = this.GetHeartLink(this.clickedHeart).get(); this.RefreshScreen(); this.PulseHeart(this.clickedHeart); this.PulseBorder(); } else { this.GetHeartLink(this.overHeart).set(this.GetHeartLink(this.clickedHeart).get()); this.PulseHeart(this.clickedHeart); this.PulseHeart(this.overHeart); } } this.PulsePlayerLey(); this.currentState = ClickState.Idle; this.clickedHeart = Heart.None; this.GetHeartAnimator(heart).SetBool("Clenched", false); }
void Awake() { initGrid(); initMesh(mainMesh, ref mainUVs); heart = new Heart(this); }
private void CreateHeart() { Heart heart = Instantiate(_heartTemplate, transform); _aliveHearts.Add(heart); }
public void LoadWorld() { Instantiate(worldMap); Instantiate(Walls, new Vector3(0, 11), Walls.transform.rotation); GameObject playerInstance = Instantiate(player); playerInstance.transform.position = new Vector3(0, -2f); playerInstance.GetComponent<PlayerNodeState>().x = 2; playerInstance.GetComponent<PlayerNodeState>().y = 2; if (!alreadyLoaded) { GameObject items = Instantiate(Initialitems); DontDestroyOnLoad(items); inventoryInstance = Instantiate(Inventory); #region inventory inventoryInstance.transform.SetParent(canvas.transform); inventoryInstance.transform.localScale = Vector3.one; inventoryInstance.GetComponent<RectTransform>().anchoredPosition = new Vector3(-100, inventoryInstance.transform.position.y); StartCoroutine(WaitTillGenerateDatabase(inventoryInstance.GetComponent<InventoryLogic>())); alreadyLoaded = true; DontDestroyOnLoad(inventoryInstance); #endregion #region heart heartInstance = Instantiate(heart); heartInstance.transform.SetParent(canvas.transform); heartInstance.GetComponent<RectTransform>().anchoredPosition = new Vector2(70, -70); heartComponent = heartInstance.GetComponent<Heart>(); heartComponent.isNormalHeartRate = true; #endregion } playerInstance.GetComponent<StealthGameMode>().heart = heartComponent; playerInstance.GetComponent<PlayerTransition>().heart = heartComponent; playerInstance.GetComponent<PlayerInteraction>().InitInventory(inventoryInstance); #region Bosses if (!defeatedSleep) { GameObject sleepBossInstance = Instantiate(sleepBoss); sleepBossInstance.name = "SleepBoss"; sleepBossInstance.transform.position = new Vector3(0, 13); SleepBossState sleepBossState = sleepBossInstance.GetComponent<SleepBossState>(); playerInstance.GetComponent<PlayerNodeState>().sleepBoss = sleepBossState; playerInstance.GetComponent<StealthGameMode>().sleepBoss = sleepBossState; } #endregion }
public virtual void OnMouseUp() { if (!transform.parent) { line.enabled = false; GetComponent <Rigidbody2D>().isKinematic = false; GetComponent <BoxCollider2D>().isTrigger = false; if (GetComponent <Rigidbody2D>().velocity.magnitude > topSpeed) { force = GetComponent <Rigidbody2D>().velocity.normalized *topSpeed; } if (nearestCube && (nearestCube.name == "Heart" || nearestCube.transform.parent)) { Cube cube = nearestCube.GetComponent(typeof(Cube)) as Cube; Vector3 dir = transform.position - nearestCube.transform.position; dir = cube.heartParent.transform.InverseTransformDirection(dir); float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg + 180; if (canAddBlock(angle, nearestCube.GetComponent(typeof(Cube)) as Cube)) { cube = nearestCube.GetComponent(typeof(Cube)) as Cube; applyHeartRotation(cube); heartParent = cube.heartParent; transform.SetParent(heartParent.transform); GetComponent <Rigidbody2D>().isKinematic = true; if (dirToNearestCollider == Direction.North) { transform.position = new Vector3( nearestCube.transform.position.x + Mathf.Cos(heartParent.transform.eulerAngles.z * Mathf.Deg2Rad + Mathf.PI / 2) * (1 + placementOffset), nearestCube.transform.position.y + Mathf.Sin(heartParent.transform.eulerAngles.z * Mathf.Deg2Rad + Mathf.PI / 2) * (1 + placementOffset), 0 ); nearestCube.GetComponent <Cube>().cubeNorth = this; cubeSouth = nearestCube.GetComponent <Cube>(); } if (dirToNearestCollider == Direction.East) { transform.position = new Vector3( nearestCube.transform.position.x + Mathf.Cos(heartParent.transform.eulerAngles.z * Mathf.Deg2Rad) * (1 + placementOffset), nearestCube.transform.position.y + Mathf.Sin(heartParent.transform.eulerAngles.z * Mathf.Deg2Rad) * (1 + placementOffset), 0 ); nearestCube.GetComponent <Cube>().cubeEast = this; cubeWest = nearestCube.GetComponent <Cube>(); } if (dirToNearestCollider == Direction.South) { transform.position = new Vector3( nearestCube.transform.position.x - Mathf.Cos(heartParent.transform.eulerAngles.z * Mathf.Deg2Rad + Mathf.PI / 2) * (1 + placementOffset), nearestCube.transform.position.y - Mathf.Sin(heartParent.transform.eulerAngles.z * Mathf.Deg2Rad + Mathf.PI / 2) * (1 + placementOffset), 0 ); nearestCube.GetComponent <Cube>().cubeSouth = this; cubeNorth = nearestCube.GetComponent <Cube>(); } if (dirToNearestCollider == Direction.West) { transform.position = new Vector3( nearestCube.transform.position.x - Mathf.Cos(heartParent.transform.eulerAngles.z * Mathf.Deg2Rad) * (1 + placementOffset), nearestCube.transform.position.y - Mathf.Sin(heartParent.transform.eulerAngles.z * Mathf.Deg2Rad) * (1 + placementOffset), 0 ); nearestCube.GetComponent <Cube>().cubeWest = this; cubeEast = nearestCube.GetComponent <Cube>(); } updateNearCubes(); } } dirToNearestCollider = null; hitColliders = null; nearestCube = null; } }
private void Start() { heart = new Heart(m_Image); }
// Use this for initialization void Start() { heart = FindObjectOfType(typeof(Heart)) as Heart; NBAJAMZ2013 = false; }
// Use this for initialization void Start() { heart = GameObject.FindObjectOfType <Heart>(); InvokeRepeating("decreaseTime", 1f, 1f); }
private void Spawn(Heart heartPrefab, Action <GridObject, Vector2Int> setGridObject, Func <Vector2Int> randomCoord) { var heart = Instantiate(heartPrefab); setGridObject?.Invoke(heart, randomCoord?.Invoke() ?? Vector2Int.zero); }
public string ImportUser(string filePath) { var msg = new StringBuilder(); var data = new DataTable(); try { data = ExcelHelpers.ImportExcelToDataTable(filePath); } catch (Exception ex) { msg.AppendLine("导入失败!"); msg.AppendLine("1.请确认模板是否正确,或者下载最新模板"); msg.AppendLine("2.请确认Excel中没有空的行"); msg.AppendLine("3.请勿对行进行增删操作"); return(msg.ToString()); } if (data.Rows.Count == 0) { return("无法导入,用户信息为空"); } var addUserList = new List <User>(); foreach (DataRow row in data.Rows) { //1. first to validate required property if (string.IsNullOrEmpty(row["姓名"].ToString()) || string.IsNullOrEmpty(row["电话"].ToString()) || string.IsNullOrEmpty(row["生日"].ToString()) || string.IsNullOrEmpty(row["过期时间"].ToString()) || string.IsNullOrEmpty(row["性别"].ToString())) { msg.AppendLine($"必要字段缺失请检查姓名,电话,行号:{data.Rows.IndexOf(row) + 1}"); continue; } var birthday = Convert.ToDateTime(row["生日"]); var comments = row["备注"].ToString(); var expireTime = Convert.ToDateTime(row["过期时间"]); var mobile = row["电话"].ToString(); var name = row["姓名"].ToString(); var sex = row["性别"].ToString(); if (IsRepetitionUser(name, mobile)) { msg.AppendLine($"该用户已存在,名字:{name},电话:{mobile},行号:{data.Rows.IndexOf(row) + 1}"); continue; } if (expireTime < DateTime.Now) { msg.AppendLine($"无法导入,过期时间小于当前时间,名字:{name},电话:{mobile},行号:{data.Rows.IndexOf(row) + 1}"); continue; } User user = new User() { Id = Guid.NewGuid(), Birthday = birthday, Comments = comments, CreatedTime = DateTime.Now, ExpireTime = expireTime, Mobile = mobile, Name = name, Sex = sex }; addUserList.Add(user); } using (var db = Heart.CreateBookDbContext()) { db.Users.AddRange(addUserList); db.SaveChanges(); } if (string.IsNullOrEmpty(msg.ToString())) { return("用户导入成功"); } return(msg.ToString()); }
static void Main(string[] args) { Heart.StartBeating(); }
public void DrawHeart(Heart heart) { spritebatch.Draw(Texture_Heart, ConvertRectangle(new Rectangle(heart.position.x, heart.position.y, heart.size.y, heart.size.y)), Color.Red); }
public string ImportBooks(string filePath) { var msg = new StringBuilder(); var data = new DataTable(); try { data = ExcelHelpers.ImportExcelToDataTable(filePath); } catch (Exception ex) { msg.AppendLine("导入失败!"); msg.AppendLine("1.请确认模板是否正确,或者下载最新模板"); msg.AppendLine("2.请确认Excel中没有空的行"); msg.AppendLine("3.请勿对行进行增删操作"); return(msg.ToString()); } if (data.Rows.Count == 0) { return("无法导入,图书信息为空"); } var addBookList = new List <Book>(); var bookTypeList = new List <BookType>(); foreach (DataRow row in data.Rows) { var bookNumber = row["图书编号"].ToString(); var name = row["图书名称"].ToString(); var type = row["图书类型"].ToString(); // validate requirement property //1. first to validate required property if (string.IsNullOrEmpty(bookNumber) || string.IsNullOrEmpty(name) || string.IsNullOrEmpty(type)) { msg.AppendLine($"必要字段缺失请检查图书编号,图书名称和图书类型.,行号:{data.Rows.IndexOf(row) + 1}"); continue; } // validate repetition book if (IsRepitionBook(bookNumber)) { msg.AppendLine($"该书已经存在,书名:{name},书籍编码:{bookNumber},行号:{data.Rows.IndexOf(row) + 1}"); continue; } // validate repetition book type if (!IsRepitionBookType(type)) { // add book type var bookType = new BookType() { Id = Guid.NewGuid(), TypeName = type, CreatedTime = DateTime.Now }; bookTypeList.Add(bookType); } // add book var book = new Book() { Id = Guid.NewGuid(), BookNumber = bookNumber, CreatedTime = DateTime.Now, Name = name, Type = type }; addBookList.Add(book); } using (var db = Heart.CreateBookDbContext()) { db.Books.AddRange(addBookList); db.BookTypes.AddRange(bookTypeList); db.SaveChanges(); } if (string.IsNullOrEmpty(msg.ToString())) { return("书籍导入成功"); } return(msg.ToString()); }
public CaptainPlanet(Earth earth, Wind wind, Fire fire, Water water, Heart heart) { }
// Use this for initialization void Start() { anim = GetComponent <tk2dAnimatedSprite>(); camera = FindObjectOfType(typeof(Camera)) as Camera; heart = FindObjectOfType(typeof(Heart)) as Heart; }
void OnTriggerEnter(Collider other) { if(other.tag == "Heart"){ bnTowerIsActive=true; heart=other.GetComponent<Heart>(); heart.transform.position=transform.position; //heart.gameObject.renderer.enabled=false; heart.speed=0; heart.gameObject.audio.clip=heart.jumpInSound; heart.gameObject.audio.Play(); if(scriptHealthProjector) { scriptHealthProjector.PulseEnable(bnTowerIsActive); } } if(other.gameObject.layer==8){ Debug.Log ("hit"); TakeDamage(10); Destroy(other.gameObject); } }
// Estensione di AddHeart in modo da aumentare il limite massimo di cuori Red // Ho commentato solo le parti diverse dal metodo precedente public void AddHeart(int heartsToAdd, Heart heartType, bool isPowerUp) { switch (heartType) { case Heart.Red: int lastRedHeartIndex = hearts.LastIndexOf(Heart.Red); // Controllo se è il caso in cui devo aumentare cuori Red aggiuntivi if (isPowerUp) { // Conto il numero di cuori da aggiungere al limite massimo // ho fatto tutti i passsaggi per la chiarezza, non per l'efficienza int currentRedHearts = maxRedHearts - lastRedHeartIndex + 1; int newMaxRedHearts = currentRedHearts + heartsToAdd; int emptyHeartsToAdd = newMaxRedHearts - maxRedHearts; // Se il numero degli elementi è uguale al massimo, vuol dire che non ho altri elementi dopo i Red o Empty // e posso aggiungere i nuovi Empty in fondo alla lista if (hearts.Count == maxRedHearts) { for (int i = 0; i < emptyHeartsToAdd; i++) { hearts.Add(Heart.Empty); } } // Se il numero degli elementi è maggiore, vuol dire che ho altri elementi dopo i Red o Empty // e inserisco i nuovi Empty dopo l'ultimo elemento dei Red o Empty else if (hearts.Count > maxRedHearts) { for (int i = 0; i < emptyHeartsToAdd; i++) { hearts.Insert(maxRedHearts + 1, Heart.Empty); } } // Aggiorno il valore massimo dei cuori Red che il player può avere maxRedHearts = newMaxRedHearts; } // Guardo se l'indice dell'ultimo cuore Red è minore o uguale al numero massimo di cuori Red che è possibile avere // Se è minore rimpiazzo i cuori successivi, che saranno Empty, // con cuori Red fino a che o non raggiungo i cuori massimi o non finisco i cuori da aggiungere for (int i = 0; i < heartsToAdd; i++) { if (lastRedHeartIndex + i + 1 <= maxRedHearts) { hearts[lastRedHeartIndex + i + 1] = Heart.Red; } } break; case Heart.Blue: for (int i = 0; i < heartsToAdd; i++) { if (hearts.Count == maxRedHearts) { hearts.Add(Heart.Blue); } else if (hearts.Count > maxRedHearts) { hearts.Insert(maxRedHearts + 1, Heart.Blue); } } break; case Heart.Black: for (int i = 0; i < heartsToAdd; i++) { hearts.Add(Heart.Black); } break; default: break; } }
public Chest(Bone[] chestBoneStructure = null, Heart heart = null, RespiratorySystem lungs = null) { Bones = chestBoneStructure ?? DefaultBoneStructures.DefaultChestBones; Heart = heart ?? new Heart(); Lungs = lungs ?? new RespiratorySystem(); }
private Beast.BeastLink GetHeartLink(Heart heart) { switch (heart) { case Heart.Left: return new Beast.BeastLink(this.GetPlayer(), new string[]{"left"}); case Heart.Right: return new Beast.BeastLink(this.GetPlayer(), new string[]{"right"}); case Heart.Up: return new Beast.BeastLink(this.GetPlayer(), new string[]{"up"}); case Heart.Down: return new Beast.BeastLink(this.GetPlayer(), new string[]{"down"}); } return null; }
// Use this for initialization void Start () { audioPlayer = this.GetComponent<AudioPlayer>(); seducedIndex = GameManager.seducedIndex - 1; winnerIndex = GameManager.winnerIndex; endScore = GameManager.score[GameManager.winnerIndex]; flashIcon = true; flashTimer = 0; flashDelayDefault = 1f; flashDelay = flashDelayDefault; flashDelayIncrement = 0.1f; flashCount = 0; maxFlashes = 25; flashing = true; //particles heartCount = 10; hearts = new Heart[heartCount]; for (int i = 0; i < heartCount; i++) { Heart tempHeart = new Heart(); tempHeart.accel = new Vector2(); tempHeart.accel.x = Random.Range(-3f,3f); tempHeart.accel.y = Random.Range(-3f,3f); tempHeart.vel = new Vector2(); tempHeart.vel.x = Random.Range(-1f,1f); tempHeart.vel.y = Random.Range(-1f,1f); tempHeart.pos = new Vector2(); tempHeart.pos.x = (float)Screen.width / 2; tempHeart.pos.y = (float)Screen.height / 2; tempHeart.icon = par_heart; hearts[i] = tempHeart; } }
private void AddHeartCluster() { //randomize location RandomGenerator randomGenerator = ServiceManager.Instance.GetService<RandomGenerator>(ServiceType.RandomGenerator); int heartCount = randomGenerator.Next(3, 10); int sourceXcoord = randomGenerator.NextXLocation(); int sourceYcoord = randomGenerator.NextYLocation(); for (int i = 0; i < heartCount; i++) { Heart heart = new Heart(); heart.rotation = (float)randomGenerator.NextDouble(-.524, .524); //-30 degress to +30 degrees heart.xcoord = randomGenerator.Next(sourceXcoord - 25, sourceXcoord + 25); heart.ycoord = randomGenerator.Next(sourceYcoord - 25, sourceYcoord + 25); heart.size = (int)(heartTexture.Width * randomGenerator.NextDouble(.03, .10)); listHearts.Add(heart); } totalHeartClusters++; nextHeartCluster = DateTime.Now + TimeBetweenHearts; }
void InitSwaps() { Angry.setPosition(new Position(Level.Excluded, Circle.Green)); Blessing.setPosition(new Position(Level.Excluded, Circle.Purple)); Child.setPosition(new Position(Level.Excluded, Circle.Red)); Curse.setPosition(new Position(Level.Excluded, Circle.Cyan)); Heaven.setPosition(new Position(Level.Tertiary, Circle.GreenPurpleRed)); Happiness.setPosition(new Position(Level.Tertiary, Circle.GreenRedCyan)); Dragon.setPosition(new Position(Level.Tertiary, Circle.RedCyanPurple)); Dream.setPosition(new Position(Level.Secondary, Circle.CyanRed)); Energy.setPosition(new Position(Level.Secondary, Circle.GreenRed)); Female.setPosition(new Position(Level.Secondary, Circle.CyanPurple)); Force.setPosition(new Position(Level.Quaternary, Circle.GreenRedCyanPurple)); Forest.setPosition(new Position(Level.Excluded, Circle.Purple)); Friend.setPosition(new Position(Level.Secondary, Circle.GreenPurple)); Hate.setPosition(new Position(Level.Secondary, Circle.GreenPurple)); Hope.setPosition(new Position(Level.Excluded, Circle.Green)); Kindness.setPosition(new Position(Level.Tertiary, Circle.CyanPurpleGreen)); Longevity.setPosition(new Position(Level.Secondary, Circle.CyanPurple)); Love.setPosition(new Position(Level.Secondary, Circle.CyanPurple)); Loyal.setPosition(new Position(Level.Secondary, Circle.GreenRed)); Spirit.setPosition(new Position(Level.Secondary, Circle.CyanRed)); Male.setPosition(new Position(Level.Quaternary, Circle.GreenRedCyanPurple)); Mountain.setPosition(new Position(Level.Secondary, Circle.GreenRed)); Night.setPosition(new Position(Level.Excluded, Circle.Red)); Pure.setPosition(new Position(Level.Secondary, Circle.GreenPurple)); Heart.setPosition(new Position(Level.Secondary, Circle.CyanRed)); River.setPosition(new Position(Level.Excluded, Circle.Cyan)); Emotion.setPosition(new Position(Level.Excluded, Circle.Cyan)); Soul.setPosition(new Position(Level.Excluded, Circle.Purple)); Urgency.setPosition(new Position(Level.Excluded, Circle.Red)); Wind.setPosition(new Position(Level.Excluded, Circle.Green)); Debug.LogFormat("[Dragon Energy #{0}] Before swapping, the displayed words are:", _moduleId); for (int i = 0; i < displayed.Length; i++) { Debug.LogFormat("[Dragon Energy #{0}] {1} = {2}", _moduleId, displayed[i].getWord(), displayed[i].getPosition().getCircle().ToReadable()); } char[] letters = info.GetSerialNumberLetters().ToArray(); int vowelCount = 0; foreach (char letter in letters) { if (letter == 'A' || letter == 'E' || letter == 'I' || letter == 'O' || letter == 'U') { vowelCount++; } } if (info.GetBatteryCount() > 10 && (info.GetSerialNumberNumbers().ToArray()[info.GetSerialNumberNumbers().ToArray().Length - 1] == 5 || info.GetSerialNumberNumbers().ToArray()[info.GetSerialNumberNumbers().ToArray().Length - 1] == 7)) { Swaps(1); } else if (info.GetPortPlateCount() > info.GetBatteryHolderCount() && (modules.Contains("Morse War") || modules.Contains("Double Color"))) { Swaps(2); } else if ((info.IsIndicatorOn(Indicator.SIG) && info.IsIndicatorOn(Indicator.FRK)) || (info.GetOffIndicators().Count() == 3)) { Swaps(3); } else if (info.GetModuleNames().Count() > 8) { Swaps(4); } else if (vowelCount >= 2) { Swaps(5); } else if (info.GetSolvedModuleNames().Count() == 0) { Swaps(6); dependsOnSolvedModules = true; } else { Swaps(7); } Debug.LogFormat("[Dragon Energy #{0}] After swapping, the displayed words are:", _moduleId); for (int i = 0; i < displayed.Length; i++) { Debug.LogFormat("[Dragon Energy #{0}] {1} = {2}", _moduleId, displayed[i].getWord(), displayed[i].getPosition().getCircle().ToReadable()); } }
// Use this for initialization void Start() { anim = GetComponent<tk2dAnimatedSprite>(); camera = FindObjectOfType(typeof(Camera)) as Camera; heart = FindObjectOfType(typeof(Heart)) as Heart; }
void Start() { myText.text = Heart.p.ToString(); Heart.reset(); }
/// <summary> /// Creates a new Heartbeat instance /// </summary> /// <param name="defibKey">The key provided by defib.io which allows you to send heartbeats</param> /// <param name="defibInterval">How often a heartbeat should be sent to defib.io in minutes</param> public Heartbeat(string defibKey, int defibInterval, bool mock = false) { Reporter.initialize(); heart = new Heart(defibKey, defibInterval, mock); }
public SituationBuilder( Transform tableLevel, Transform windowLevel, Heart heart) : base(tableLevel, windowLevel, heart) { }
void OnTriggerEnter2D(Collider2D other) { if (thisRigidbody2D.velocity.y < 0) { if (other.tag == "Platform") { Jump(); other.GetComponent <SpriteRenderer>().color = Random.ColorHSV(0.25f, 0.25f, 0.25f, 0.8f, 0.8f, 0.8f); } if (other.tag == "FallingPlatform") { Jump(); miniJump(); Transform platformParent = other.transform.parent; MakePlatformSolid(platformParent); other.GetComponent <SpriteRenderer>().color = Random.ColorHSV(0f, 1f, 1f, 1f, 0.5f, 1f); } } if (other.tag == "HeadHitbox") { Transform moodkillerTransform = other.gameObject.transform.parent; moodkillerTransform.GetComponent <SpriteRenderer>().color = Color.red; moodkillerTransform.GetComponent <MoodKiller>().kill(); moodkillersDefeated++; Jump(); ShakeScreen(); } else if (other.tag == "AngryMoodKillerHeadHitbox") { Transform moodkillerTransform = other.gameObject.transform.parent; moodkillerTransform.GetComponent <SpriteRenderer>().color = Color.red; moodkillerTransform.GetComponent <AngryMoodKiller>().kill(); moodkillersDefeated++; Jump(); ShakeScreen(); } else if (other.tag == "MoodKiller") { if (hearts < 1) { Kill(); } else { StartCoroutine(BecomeSad(1.0f)); hearts--; lostLifeSound(); ShakeScreen(); } other.GetComponent <MoodKiller>().kill(); moodkillersDefeated++; } else if (other.tag == "AngryMoodKiller") { if (hearts < 1) { Kill(); } else { StartCoroutine(BecomeSad(1.0f)); hearts--; lostLifeSound(); ShakeScreen(); Jump(); } other.GetComponent <AngryMoodKiller>().kill(); moodkillersDefeated++; } else if (other.tag == "Heart") { Heart heart = other.GetComponent <Heart>(); heart.Kill(); hearts++; ShakeScreen(); collectHeartSound(); StartCoroutine(BecomeHappier(1.0f)); } }
public void SetHeartReference(Heart _destinationX) { m_HeartReference = _destinationX; }
private void updateMapList(string search, bool thread = false) { if (this.listing) { return; } if (thread) { listingThread = new System.Threading.Thread(new System.Threading.ThreadStart(delegate { updateMapList(search); })); listingThread.Start(); return; } try { this.listing = true; string data = String.Empty; using (WebClient WEB = new WebClient()) data = WEB.DownloadString(listUrl + "?search=" + Heart.UrlEncode(search)); if (String.IsNullOrEmpty(data)) { MessageBox.Show("No data was recieved.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); goto end; } if (data.ToLower().StartsWith("error")) { MessageBox.Show(data, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); goto end; } ArrayList dataObj = (ArrayList)serializer.Deserialize(data); lmc.Clear(); foreach (object obj in dataObj) { Hashtable tbl = (Hashtable)obj; lmc.Add(new LavaMapBrowserData(Convert.ToInt32(tbl["id"]), Convert.ToInt32(tbl["time"]), tbl["name"].ToString(), tbl["author"].ToString(), tbl["desc"].ToString(), tbl["image_location"].ToString())); } if (this.InvokeRequired) { this.Invoke(new MethodInvoker(delegate { dgvMaps.DataSource = null; dgvMaps.DataSource = lmc; foreach (DataGridViewColumn column in dgvMaps.Columns) { column.Width = 108; } })); goto end; } dgvMaps.DataSource = null; dgvMaps.DataSource = lmc; foreach (DataGridViewColumn column in dgvMaps.Columns) { column.Width = 108; } end: this.listing = false; } catch (Exception ex) { this.listing = false; Server.ErrorLog(ex); MessageBox.Show("An unknown error occurred.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void DestroyHeart(Heart heart) { _hearts.Remove(heart); Destroy(heart.gameObject); }
public string Heartbeat() { return(Heart.Report()); }
private void Heart_pressed(object sender, TappedRoutedEventArgs e) { Heart.Play(); }
void Heart_OnHeartCollected(Heart coin) { GetComponent <Animator>().SetTrigger("Collect"); }
void Start() { player1 = GameObject.Find("Player 1").GetComponent<Player>(); player2 = GameObject.Find("Player 2").GetComponent<Player>(); player3 = GameObject.Find("Player 3").GetComponent<Player>(); player4 = GameObject.Find("Player 4").GetComponent<Player>(); heart = GameObject.Find("Heart").GetComponent<Heart>(); manager = GetComponent<Manager>(); }
private void tmMain_Tick(object sender, EventArgs e) { if (score >= 300) { winGame(); } else { checkLevelForPlayer(); if (isStartShip) { ship.Left += speedShip; if (ship.Left >= this.Width) { ship.Left = 0; } } int n = 1; //số boom max if (score > 5) { n = 3; } if (score > 15) { n = 5; } if (score > 100) { n = 6; speedBomb = 30; } if (haveBomb < n) { createBomb(); haveBomb++; haveboom.Text = haveBomb.ToString(); } foreach (Control fish in Controls) { if (fish.Tag != null) { if (fish is PictureBox && fish.Tag != "player" && fish.Tag != "bomb" && fish.Tag != "heart") { isFishForEat(fish as PictureBox); } } } foreach (Control bomb in Controls) { if (bomb is PictureBox && bomb.Tag == "bomb") { isBomb(bomb as PictureBox); } } if (heart < 2 && bonus_Heart == 0 && score > 30) { timer_Heart.Enabled = true; } else { timer_Heart.Enabled = false; } foreach (Control Heart in Controls) { if (Heart is PictureBox && Heart.Tag == "heart") { if (Heart.Bounds.IntersectsWith(player.Bounds)) { heart++; lbHeart.Text = "Heart: " + heart; this.Controls.Remove(Heart); Heart.Dispose(); bonus_Heart = 0; } else { Heart.Top += 15; if (Heart.Bounds.IntersectsWith(panel1.Bounds)) //panel đặt ở cuối màn hình { bonus_Heart = 0; Heart.Dispose(); } } } } } this.Update(); }
public virtual void DoSpecialEffect(Heart h) { return; }
private void DestroyHeart(Heart heart) { _hearts.Remove(heart); heart.ToEmpty(); }
public void BeforeEveryTest() { m_image = new GameObject().AddComponent <Image>(); m_heart = new Heart(m_image); }
private void CreateHeart() { Heart newHeart = Instantiate(_heartTemplate, transform); _hearts.Add(newHeart); }
public void PulseHeart(Heart heart) { this.GetHeartAnimator(heart).SetTrigger("Pulse"); }
// Use this for initialization void Start() { heart = (Heart)GetComponent<Heart>(); dcRigidbody = (Rigidbody)GetComponent<Rigidbody>(); //transform = (Transform)GetComponent<Transform>(); originalCameraSize = Camera.main.orthographicSize; _gui = GameObject.Find(GUI_NAME); }
public void TileMouseOver(Tile tile) { this.overTile = tile; this.overHeart = Heart.None; switch (this.currentState) { case ClickState.Idle: this.GetPlayerLey().MouseOverPath(tile.link); tile.SetLeyLineVisibility(true); break; case ClickState.TileDown: this.UpdateLey(); break; case ClickState.HeartDown: this.UpdateLey(); break; } }
// Use this for initialization void Start() { animator=GetComponent<Animator>(); for (int z=0;z<3;++z){ hearts[z]=new Heart(new Rect(20,20+z*60,50,50),textureHeart); } }
private Animator GetHeartAnimator(Heart heart) { switch (heart) { case Heart.Left: return this.leftHeartAnimator; case Heart.Right: return this.rightHeartAnimator; case Heart.Up: return this.upHeartAnimator; case Heart.Down: return this.downHeartAnimator; } return null; }