Ejemplo n.º 1
0
        /* --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- */

        public PickUp(TypeOfPickUp type, int modelId, Vector3 position, int nameId = 2) : base(modelId, position, nameId)
        {
            mainRigidbody.useGravity = false;
            mainRigidbody.mass       = float.MaxValue;

            EnableCollision(false);
            this.type = type;
        }
Ejemplo n.º 2
0
    void ChooseType()
    {
        int value = (int)(totalProbability * Random.value);
        if(value <= probabilityToBeGreenShell)
        {
            Type = TypeOfPickUp.GreenShell;
            return;
        }
        value -= probabilityToBeGreenShell;
        if(value <= probabilityToBeRedShell)
        {
            Type = TypeOfPickUp.RedShell;
            return;
        }

        value -= probabilityToBeRedShell;
        if (value <= probabilityToBeBlueShell)
        {
            Type = TypeOfPickUp.BlueShell;
            return;
        }

        value -= probabilityToBeBlueShell;
        if (value <= probabilityToBeRepair)
        {
            Type = TypeOfPickUp.Repair;
            return;
        }

        value -= probabilityToBeRepair;
        if (value <= probabilityToBeNitro)
        {
            Type = TypeOfPickUp.Nitro;
            return;
        }
    }
 void Start()
 {
     _pickUpEffect = (TypeOfPickUp)Random.Range(0, Enum.GetNames(typeof (TypeOfPickUp)).Length);
 }