Exemplo n.º 1
0
    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]);
    }
Exemplo n.º 2
0
    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();
        }
    }
Exemplo n.º 3
0
    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();
        }
    }