void OnTriggerEnter(Collider c) { Debug.LogWarning("Something collided with the powerup"); playerscript = c.GetComponent <PowerUpsHud>(); if (c.gameObject.tag == "Player" && !playerscript.OnePowerUp) { GameObject g; if (c.name == "bottom") { g = c.transform.parent.gameObject; } else { g = c.gameObject; } if (g == LocalPlayer) { Debug.LogWarning("Doing Ground on " + g); playerscript.DoUpdate("2"); } else { Debug.LogWarning("Someone else collided with the powerup, removing it"); } Destroy(gameObject); } }
void OnTriggerEnter(Collider c) { Debug.LogWarning("Something collided with the powerup"); playerscript = c.GetComponent <PowerUpsHud>(); if (c.gameObject.tag == "Player") { GameObject g; if (c.name == "bottom") { g = c.transform.parent.gameObject; } else { g = c.gameObject; } if (g == LocalPlayer && !playerscript.OnePowerUp) { Debug.LogWarning("Doing Swap on " + g); playerscript.DoUpdate("3"); g.transform.Find("Canvas/PowerCanvas/Swap").gameObject.GetComponent <Image>().enabled = true; } else { Debug.LogWarning("Someone else collided with the powerup, removing it"); } Destroy(gameObject); } }