Esempio n. 1
0
 public void OnPressEnterAtBeginning()
 {
     updateActive = true;
     _startGameText.SetActive(false);
     _logoImage.SetActive(false);
     if (_gameManager.firstGame)
     {
         cutsceneManager.ChangeCutscene(CutsceneManager.Cutscenes.INTRO);
     }
     else
     {
         Cinematic cinematic = GameObject.Find("Player").GetComponent <Cinematic>();
         cinematic.GetComponent <Cinematic>().cinematic = "Abe Rises";
         cinematic.GetComponent <Cinematic>().enabled   = true;
         GameObject.Find("GameManager").GetComponent <PerkManager>().showInstructions = true;
     }
     _healthUICanvas.alpha = 1;
 }
Esempio n. 2
0
    private void Start()
    {
        // exception handling
        if (players == null || players.Count == 0)
        {
            if (playerQueue.Count == 0)
            {
                Debug.LogError("Yo where the players at.");
                return;
            }
            else
            {
                players = playerQueue;
            }
        }

        Material playerBase = map.material;

        // spawn
        for (int i = 0; i < players.Count; ++i)
        {
            JoinInfo joinInfo = players[i];
            Team     team     = teams.group[joinInfo.team];
            // set map colour
            playerBase.SetColor("_Player" + (i + 1), team.color);
            // set player info
            Debug.Log(joinInfo.characterType);
            CharacterData data = characters.characters[joinInfo.characterType];
            // create game object accordingly
            Transform llama = Instantiate(data.characterPrefab).transform;
            // save llama rigidbody in list
            playerRBList.Add(llama.GetComponent <Rigidbody>());
            playerList.Add(llama);
            // Material
            MaterialPack pack = data.teamMaterials[joinInfo.team];
            llama.GetComponentInChildren <MaterialManager>().SetMaterialPack(pack);
            // Character info
            CharacterInfo info = llama.GetComponent <CharacterInfo>();
            info.playerID = i;
            info.team     = team.name;
            info.AI       = joinInfo.isAI;
            // Character position
            Vector3 position = bases.scoringArea[i].transform.position;
            position.y     = 1;
            llama.position = position;
            // Add to container
            llama.parent = container;
            llama.GetComponent <CharacterInput>().moveable = false;

            Cinematic camera = Instantiate(cameras[joinInfo.characterType]);
            camera.gameObject.active = true;
            camera.GetComponent <Camera>().enabled = false;
            foreach (Shot shot in camera.shots)
            {
                shot.target = llama.transform;
            }
            cameraContainer.cameras.Add(camera);
            camera.transform.parent = cameraContainer.transform;

            if (i < 2)
            {
                rotate.Add(llama);
            }
        }

        playerQueue.Clear();
        players.Clear();
    }