void OnTriggerEnter2D(Collider2D other) { if (!isServer) { return; } // check to see if the egg was retrieved if (carried) { if (other.tag == "Shrine") { // end the game GameObject.Find("GameState").GetComponent <GameStateManager>().ResetGame(); Destroy(this.gameObject); } else { return; } } if (other.tag == "Player") { if (other.gameObject.GetComponent <PlayerHealth> ().alive) { Debug.Log(other.gameObject.name + " is picking up the object"); CmdSetCarried(other.gameObject.name); notificationText.SetTimedNotice("Return the egg!", Color.white, 3); } } }
public void SetPlayerTimedNotification(string notice, Color color, float time) { if (isLocalPlayer) { noticeText.SetTimedNotice(notice, color, time); } }
void RpcSetPet(GameObject newPet) { Debug.Log(control); Debug.Log(newPet); control.SetPet(newPet); shopText.SetTimedNotice("Press " + control.input.Button("Activate") + " to activate your pet's ability!", Color.white, 5f); }
public void BringToDeath() { if (alive) { playerControl.enabled = false; StartCoroutine(WaitForGhost()); ToggleAlive(); notificationText.SetTimedNotice("Oh no, return to the shrine to revive.", Color.white, 3); } }
// Update is called once per frame // void Update () { // // } void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { other.GetComponent <PlayerMove> ().MoveTo(toX, toY); // Camera.main.transform.position = new Vector3 (toX, toY, Camera.main.transform.position.z); if (isEnd && other.GetComponent <PlayerHealth> ().alive) { ServerComm serverComm = other.gameObject.GetComponent <ServerComm> (); serverComm.RequestMap(); serverComm.MovePlayers(toX, toY); } else { if (mapGen.gameMode == MapGen.GameMode.Steal) { notificationText.SetTimedNotice("Steal the egg!", Color.white, 3); } } } }