void onCollision(Rigidbody body, EntityPlayer entity, Vector3 impactPoint) { if (entity != null && (entity.m_team == GameData.TEAM.RED || entity.m_team == GameData.TEAM.BLUE)) { onDirectHit(entity); } m_state = PUNCH_STATE.EXPLODING; m_rigidbody.velocity = Vector3.zero; m_triggerEnter.enabled = false; }
private void Update() { if (m_state == PUNCH_STATE.EXPLODING) { m_state = PUNCH_STATE.DEAD; return; } if (m_state == PUNCH_STATE.DEAD) { NetworkServer.Destroy(m_entity.gameObject); } if ((m_entity.transform.position - m_lastPosition).magnitude > m_shieldDeployInterval) { var dir = (m_entity.transform.position - m_lastPosition).normalized; var newPos = m_lastPosition + dir * m_shieldDeployInterval; hprDeployShieldAt(newPos, dir); m_networkloader.RpcLoadPrefab_Separate(PREFAB_ID.MONK_PUNCH_SHIELD, m_team, newPos, dir); m_lastPosition = newPos; } // NetworkServer.Destroy(m_entity.gameObject); }