public void AddRock(RockIndentifier rock) { rocks.Add(rock); int i = rand.Next(0, sps.Count); rock.transform.position = sps[i].position; sps.Remove(sps[i]); }
void OnTriggerExit(Collider other) { if (isComplete) { return; } if (other.name.StartsWith("Rock") && isServer) { RockIndentifier r = other.GetComponent <RockIndentifier>(); if (currentRocks.Contains(r)) { currentRocks.Remove(r); } } if (other.CompareTag("Player") && isServer) { currentWeightOffset -= other.GetComponent <PlayerWeight>().getWeight(); } }
void OnTriggerEnter(Collider other) { if (isComplete) { return; } if (other.name.StartsWith("Rock") && isServer) { //currentWeight = other.GetComponent<RockIndentifier> ().weight; //currentWeight += other.GetComponent<RockIndentifier>().weight; RockIndentifier r = other.GetComponent <RockIndentifier>(); if (!currentRocks.Contains(r)) { currentRocks.Add(r); } } if (other.CompareTag("Player") && isServer) { currentWeightOffset += other.GetComponent <PlayerWeight>().getWeight(); } }