Example #1
0
    /// <summary>
    /// Upon start this method sets the default values to be
    /// displayed on the status screen.
    /// </summary>
    void Start()
    {
        PlayerScript pScript = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerScript> ();
        int          myPNum  = pScript.pNum;


        player1Stats.fillFields();

        //the values should be set from characterStats?


        p2Joined = false;
        p3Joined = false;
        p4Joined = false;

        p2StatsGroup.gameObject.SetActive(false);
        p3StatsGroup.gameObject.SetActive(false);
        p4StatsGroup.gameObject.SetActive(false);

        NetworkManagerScript myNetwork = GameObject.FindObjectOfType <NetworkManagerScript> ();

        if (myNetwork != null)
        {
            allStats = myNetwork.GetComponentInChildren <AllNetworkedStats> ();


            if (allStats.gpas.Count > 1)
            {
                p2Joined = true;
            }
            if (allStats.gpas.Count > 2)
            {
                p3Joined = true;
            }
            if (allStats.gpas.Count > 3)
            {
                p4Joined = true;
            }
        }

        //These values need to be set based on number of players during multi-player game

        for (int i = 0; i < allStats.playerID.Count; i++)
        {
            if (myPNum != allStats.playerID [i])
            {
                GPAs.Add(allStats.gpas [i]);
                standings.Add(allStats.standings [i]);
                playerNames.Add(allStats.pNames [i]);
            }
        }



        //call method to set visibility
        SetPlayerVisibility(p2StatsGroup, p2Joined, 0);
        SetPlayerVisibility(p3StatsGroup, p3Joined, 1);
        SetPlayerVisibility(p4StatsGroup, p4Joined, 2);
    }
Example #2
0
 // Use this for initialization
 void Start()
 {
     if (networkView.isMine) {
         netScript = (NetworkManagerScript) GameObject.Find("NetworkManager").GetComponent("NetworkManagerScript");
         sCol = (SphereCollider) gameObject.GetComponent("SphereCollider");
             //GetComponent<SphereCollider>();
         //sCol.enabled = false;
     } else {
         enabled = false;
     }
 }
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Example #4
0
    private void Awake()
    {
        this.rb2d           = GetComponent <Rigidbody2D>();
        this.transform      = GetComponent <Transform>();
        this.animator       = GetComponent <Animator>();
        this.boardScript    = GetComponent <BoardManager>();
        this.inventory      = GetComponent <InventorySystem>();
        this.networkManager = GameObject.Find("NetworkManager").GetComponent <NetworkManagerScript>();
        this.healthManager  = GameObject.Find("Canvas").GetComponent <HealthManager>();

        this.joystick = FindObjectOfType <Joystick>();
    }
Example #5
0
    void Awake()
    {
        GameObject game = GameObject.FindGameObjectWithTag ("GameController");
        networkManager = game.GetComponent<NetworkManagerScript> ();

        if (networkView.isMine)
            cam = game.GetComponent<CameraControllerScript> ();
        else
            cam = null;

        wall = (GameObject)Resources.Load ("WallObject");

        castPos = Vector3.zero;
        ClearCooldown ();
    }
 public void exitMultiplayerLobby()
 {
     if (isServer == true)
     {
         cancelMultiplayerLobby();
     }
     else if (isClientOnly == true)
     {
         commandDecrementPlayerCount();
         commandRemoveName(LoadedPlayerData.playerData.name);
         lobbyPanel.SetActive(false);
         networkManager.StopClient();
         refreshServers();
     }
     NetworkManagerScript.activateScriptCrammer();
     return;
 }
 public void createLobby()
 {
     playerCount                   = 0;
     kcpTransport.Port             = NetworkManagerScript.getAvailablePort();
     lobbyName                     = (LoadedPlayerData.playerData.name + "'s lobby.");
     networkManager.maxConnections = 5;
     try {
         networkManager.StartHost();
         StartCoroutine(nameof(checkPort));
     } catch (Exception exception) {
         Debug.LogError(exception.Message);
         customNetworkDiscovery.StopDiscovery();
         networkManager.StopHost();
         //TODO : Show error shits.
     }
     return;
 }
Example #8
0
    public void SemesterBegin()
    {
        Transcript MyScript = Resources.Load <Transcript>("myTranscript");

        MyScript.CoursesInProgress = new List <Course>();
        MyScript.GradesInProgress  = new List <float> ();

        myCourses.ForEach(x => {            //put each course onto the "taken" part of the transcript and start with Cs in all
            if (x.CourseChosen)
            {
                MyScript.CoursesInProgress.Add(x.SelectedCourse);
                MyScript.GradesInProgress.Add(2f);
            }
        });

        NetworkManagerScript myNetwork = GameObject.FindObjectOfType <NetworkManagerScript> ();

        if (myNetwork != null)
        {
            myNetwork.ChangeMade();
        }
    }
Example #9
0
    async Task Awake()
    {
        this.levels = new List <Level>();

        this.player = FindObjectOfType <PlayerScript>();
        this.networkManagerScript = GameObject.Find("NetworkManager").GetComponent <NetworkManagerScript>();


        //Check if instance already exists
        if (instance == null)
        {
            //if not, set instance to this
            instance = this;
        }

        //If instance already exists and it's not this:
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        //Sets this to not be destroyed when reloading scene
        //DontDestroyOnLoad(gameObject);

        //Get a component reference to the attached BoardManager script
        boardScript = GetComponent <BoardManager>();
        loader      = GetComponent <Loader>();

        pointsText      = GameObject.Find("PointsText").GetComponent <Text>();
        levelImage      = GameObject.Find("LevelImage");
        levelText       = GameObject.Find("LevelText").GetComponent <Text>();
        pointsText.text = "Points: " + playerPoints;


        //Call the InitGame function to initialize the first level
    }
Example #10
0
 void Start()
 {
     networkManager = GetComponent<NetworkManagerScript>();
     mainMenu = GetComponent<MainMenuScript>();
     hud = GetComponent<HUDScript>();
     pause = GetComponent<PauseMenuScript>();
 }
Example #11
0
    void Start()
    {
        networkManager = GetComponent<NetworkManagerScript>();
        mainMenu = GetComponent<MainMenuScript>();
        gameManager = GetComponent<GameManagerScript>();
        playerData = GetComponent<PlayerDataScript>();
        menuManager = GetComponent<MenuManager>();
        hud = GetComponent<HUDScript>();
        chatRoom = GetComponent<ChatRoomScript>();

        // column rects			Horizontal start		Vert Start		Width					Height
        firstCol = new Rect(	12,						 50,		Screen.width/3 - 18,	Screen.height - 50);
        secCol = new Rect(		Screen.width/3 + 6,		 50,		Screen.width/3 - 68, 	Screen.height - 50);
        thirdCol = new Rect(	2*Screen.width/3 - 44,	 50,		Screen.width/3 + 32, 	Screen.height - 50);

        //the list of teams, as strings
        List<Team> teams = Team.GetTeamList();
        teamList = new string[teams.Count];
        for(int x = 0; x < teams.Count; x++)
        {
            teamList[x] = teams[x].name;
        }
    }
 // Use this for initialization
 void Start()
 {
     nScript = GameObject.Find("NetworkManager").GetComponent <NetworkManagerScript>();
 }
Example #13
0
 // Use this for initialization
 void Start()
 {
     lobby = GetComponent<GameLobbyScript>();
     settings = GetComponent<SettingsMenu>();
     networkManager = GetComponent<NetworkManagerScript>();
 }
Example #14
0
 void Awake()
 {
     manager = GameObject.FindGameObjectWithTag("NetworkManager").GetComponent <NetworkManagerScript>();
 }
Example #15
0
 // Use this for initialization
 void Start()
 {
     platformManager = GetComponent<PlatformManagerScript>();
     networkManager = GetComponent<NetworkManagerScript>();
     spawnManager = GetComponent<SpawnManagerScript>();
     menuManager = GetComponent<MenuManager>();
     lobby = GetComponent<GameLobbyScript>();
     mainMenu = GetComponent<MainMenuScript>();
     playerData = GetComponent<PlayerDataScript>();
     gameIsActive = false;
 }
Example #16
0
    void Awake()
    {
        jumpCount = totalJumps = GameSettings.standardJumpCount;
        abilities = new List<Ability>();

        GameObject game = GameObject.FindGameObjectWithTag("GameController");
        hud = game.GetComponent<HUDScript>();
        scoreMenu = game.GetComponent<ScoreMenuScript>();
        networkManager = game.GetComponent<NetworkManagerScript>();
        playerData = game.GetComponent<PlayerDataScript>();
        nameDisplay = transform.Find("CharacterNameDisplay").GetComponent<CharacterNameDisplayScript>();
    }
Example #17
0
 void updateBoard()
 {
     Monster[] board = NetworkManagerScript.getBoardState();
     //Update the board
 }
Example #18
0
 // Use this for initialization
 void Awake()
 {
     instance = this;
 }
Example #19
0
 // Use this for initialization
 void Start()
 {
     netScript = (NetworkManagerScript) GameObject.Find("NetworkManager").GetComponent("NetworkManagerScript");
     sCol = GetComponent<SphereCollider>();
     sCol.enabled = false;
 }
Example #20
0
 private void Awake()
 {
     nm = this;
 }
 void Start()
 {
     networkManager = GetComponent<NetworkManagerScript>();
 }
    //public NetworkPlayerScript NPS;

    //Use this for initialization

    void Awake()
    {
        NMS = GameObject.Find("NetworkManager").GetComponent <NetworkManagerScript>();
        //NPS = transform.root.gameObject.GetComponent<NetworkPlayerScript>();
    }
Example #23
0
 // Use this for initialization
 void Start()
 {
     netScript = (NetworkManagerScript) GameObject.Find("NetworkManager").GetComponent("NetworkManagerScript");
 }
Example #24
0
 void Start()
 {
     networkManager = GetComponent<NetworkManagerScript>();
     playerData = GetComponent<PlayerDataScript>();
 }
Example #25
0
 void Awake()
 {
     manager = GameObject.FindGameObjectWithTag("NetworkManager").GetComponent<NetworkManagerScript>();
 }
Example #26
0
 private void Awake()
 {
     levelPaths = new List <String>();
     this.networkManagerScript = GameObject.Find("NetworkManager").GetComponent <NetworkManagerScript>();
 }
Example #27
0
    void Start()
    {
        networkManager = GetComponent<NetworkManagerScript>();
        mainMenu = GetComponent<MainMenuScript>();
        pause = GetComponent<PauseMenuScript>();
        scoreMenu = GetComponent<ScoreMenuScript>();
        chatRoom = GetComponent<ChatRoomScript>();
        chatBoxColor = new Color(1,1,1,GameSettings.chatBoxOpacity);

        chatRect = new Rect(0, 100, 300, 400);
    }
 void Start()
 {
     if (instance == null)
         instance = this;
     else if (instance != this)
         Destroy (gameObject);
 }
Example #29
0
 // Use this for initialization
 void Start()
 {
     nextMenu = PauseMenuNextMenu.NONE;
     networkManager = GetComponent<NetworkManagerScript>();
     gameManager = GetComponent<GameManagerScript>();
     settings = GetComponent<SettingsMenu>();
     mainMenu = GetComponent<MainMenuScript>();
     lobby = GetComponent<GameLobbyScript>();
     hud = GetComponent<HUDScript>();
 }