private void OnPlace(GameObject go, AbilityID ability) { Debug.Log("placed: " + go.name); GamePiece piece = go.GetComponent <GamePiece>(); piece.abilityID = ability; pieces.Add(piece); Debug.Log(((int)ability).ToString()); messenger.SendAbilityMessage("active", ((int)ability).ToString()); }
private void OnTriggerEnter(Collider other) { if (ableToAcquireAbility && other.tag == "ability") { newAbility = other.gameObject.name; netwrk.SendAbilityMessage("new", newAbility); Attack(); Destroy(other.gameObject); // Message Packer } if (ableToGrabandHold && other.tag == "item") { Attack(); Destroy(other.gameObject); // Update GUI } if (ableToBreakRocks && other.tag == "rock") { Attack(); Destroy(other.gameObject); } if (ableToChopTree && other.tag == "tree") { Attack(); Destroy(other.gameObject); } }
private void SendExampleMessage() { networkMessenger.SendAbilityMessage("new", "1"); }