예제 #1
0
    private void updateStage()
    {
        if (timeSinceStageChange >= currentStageDuration)
        {
            timeSinceStageChange = 0;
            switch (stage)
            {
            case lifeStages.SWIRLING:
                stage = lifeStages.WAITING;
                currentStageDuration = Random.Range(minTimeBetweenRounds, maxTimeBetweenRounds);
                break;

            case lifeStages.WAITING:
                stage = lifeStages.SWIRLING;
                currentStageDuration  = Random.Range(minSwirlsPerRound, maxSwirlsPerRound + 1) * windRotationTime;
                startingWindDirection = Random.Range(0, 2 * Mathf.PI);
                maxWindStrength       = Random.Range(minTopWindStrength, maxTopWindStrength);


                break;

            default:
                Debug.LogError("No stage set on blizzard trap.");
                break;
            }
        }
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        stage = lifeStages.WAITING;
        timeSinceStageChange = currentStageDuration + 1;

        float   scale    = Random.Range(minScale, maxScale);
        Vector3 newScale = new Vector3();

        newScale.x           = scale;
        newScale.y           = scale;
        newScale.z           = scale;
        transform.localScale = newScale;

        timeToLive = Random.Range(minTimeToLive, maxTimeToLive);

        buffsys = new BuffSystem();
    }