Пример #1
0
 // Start is called before the first frame update
 void Start()
 {
     WaterSpawnerRef = GameObject.FindGameObjectsWithTag("Respawn")[0];
     WScriptRef      = WaterSpawnerRef.GetComponent <WaterSpawnerScr>();
     for (int i = 0; i < WScriptRef.Levels.Length; i++)
     {
         maxPlayerWeight += WScriptRef.Levels_min_с[i];
     }
 }
Пример #2
0
    // Start is called before the first frame update
    void Start()
    {
        playerRef    = GameObject.FindGameObjectWithTag("Player");
        playerScript = playerRef.GetComponent <Character>();
        waterSpawner = GameObject.FindGameObjectWithTag("Respawn").GetComponent <WaterSpawnerScr>();
        //ID = GameObject.FindGameObjectsWithTag("Water").Length;

        for (int i = 0; i < waterSpawner.Levels.Length; i++)
        {
            if (waterSpawner.Levels[i] < waterSpawner.Levels_min_с[i])
            {
                localID = ++waterSpawner.Levels[i];
                level   = i;
                if (level + 1 > waterSpawner.level_count)
                {
                    waterSpawner.newLevel();
                }
                break;
            }
        }
        angle = angle * Mathf.Deg2Rad;
    }