Exemple #1
0
 public void OnTaskComplete_NavWay()
 {
     if (Settings_Task_NavWay != null)
     {
         Settings_Task_NavWay.Dispose();
     }
     Settings_Task_NavWay = new SettingsLevel(Settings_Task_NavEngage);
     AfterTaskComplete.InvokeIfExists();
 }
Exemple #2
0
 public void OnTaskComplete_NavRot()
 {
     if (Settings_Task_NavRot != null)
     {
         Settings_Task_NavRot.Dispose();
     }
     Settings_Task_NavRot = new SettingsLevel(Settings_Commands);
     OnTaskComplete_NavMove();
 }
Exemple #3
0
 public void OnTaskComplete_NavEngage()
 {
     if (Settings_Task_NavEngage != null)
     {
         Settings_Task_NavEngage.Dispose();
     }
     Settings_Task_NavEngage = new SettingsLevel(Settings_Task_NavMove);
     OnTaskComplete_NavWay();
 }
Exemple #4
0
 public void OnStartOfCommands()
 {
     if (Settings_Commands != null)
     {
         Settings_Commands.Dispose();
     }
     Settings_Commands = new SettingsLevel(defaultNavBlock);
     OnTaskComplete_NavRot();
 }
    // Set the settings of the level
    public void Settings(SettingsLevel settings)
    {
        movementSpeed = settings.moveSpeed;
        jumpSpeed     = settings.jumpSpeed;
        gravity       = settings.gravity;

        if (rangerAttack != null)
        {
            rangerAttack.transform.localPosition = new Vector3(rangerAttack.transform.localPosition.x, rangerAttack.transform.localPosition.y, settings.distanceRanger);
        }

        player    = settings.player;
        character = settings.character;
    }
Exemple #6
0
    // Start the game
    public GameObject StartGame(Transform parentTransform, Vector3 spawnPoint, Quaternion spawnRotation, SettingsLevel settings)
    {
        // Create the character at the right spawnlocation
        GameObject current = Instantiate(currentCharacter, spawnPoint, spawnRotation);

        current.transform.parent = parentTransform;
        character = current.GetComponent <BasicMovement>();

        // Set the name+character name
        settings.SetCharacter(name, currentCharacter.name);
        character.Settings(settings);

        // Set the right spawnpoint to the respawn location
        character.spawnPoint    = spawnPoint;
        character.rotationPoint = spawnRotation;

        // Reset the menu
        if (menuCharacter != null)
        {
            name = menuCharacter.name;
            clr  = menuCharacter.clr;
        }
        // Set the color of the character
        character.SetBasics(name, clr);

        // Set the right game state
        game = true;
        menu = false;

        // Return the current character that the controller controls
        return(current);
    }
 public void OnTaskComplete_NavMove()
 {
     if (Settings_Task_NavMove != null)
         Settings_Task_NavMove.Dispose();
     Settings_Task_NavMove = new SettingsLevel(Settings_Task_NavRot);
     OnTaskComplete_NavEngage();
 }
		public void OnTaskComplete_NavEngage()
		{
			Settings_Task_NavEngage = new SettingsLevel(Settings_Task_NavMove);
			OnTaskComplete_NavWay();
		}
		public void OnTaskComplete_NavWay()
		{
			Settings_Task_NavWay = new SettingsLevel(Settings_Task_NavEngage);
			//OnUpdate();
		}
		//public void OnGainControl()
		//{
		//	Settings_GainControl = new SettingsLevel();
		//	OnStartOfCommands();
		//}

		public void OnStartOfCommands()
		{
			Settings_Commands = new SettingsLevel(defaultNavBlock);
			OnTaskComplete_NavRot();
		}
		public void OnTaskComplete_NavRot()
		{
			Settings_Task_NavRot = new SettingsLevel(Settings_Commands);
			OnTaskComplete_NavMove();
		}
    // Start is called before the first frame update
    void Start()
    {
        playerload       = GameObject.Find("PlayerLoader");
        parentCharacters = transform.Find("Characters");
        settings         = new SettingsLevel(moveSpeed, jumpSpeed, gravity, distanceRangerAttack);

        if (playerload != null)
        {
            foreach (Transform child in playerBoardUI)
            {
                Destroy(child.gameObject);
            }

            int i = 0;
            foreach (Transform child in playerload.transform)
            {
                Vector3    spawnPoint    = new Vector3(0, 2.5f, 0);
                Quaternion rotationPoint = Quaternion.identity;

                Transform transformSpawnPoint = parentSpawnPointCharacters.GetChild(i);
                if (transformSpawnPoint != null)
                {
                    spawnPoint    = transformSpawnPoint.position;
                    rotationPoint = transformSpawnPoint.rotation;
                }

                StandardController stController = child.GetComponent <StandardController>();
                if (stController != null)
                {
                    GameObject character = stController.StartGame(parentCharacters, spawnPoint, rotationPoint, settings);

                    GameObject scoreUI = Instantiate(prefabPlayerScore, playerBoardUI);

                    PlayerManager pManager = character.GetComponent <PlayerManager>();
                    pManager.killsNeeded = killsNeeded;

                    PlayerUI uiPlayer = scoreUI.GetComponent <PlayerUI>();
                    uiPlayer.SetPlayer(pManager);
                    uiPlayer.ShowBells();
                }

                ClientServerConnection phoneConnection = child.GetComponent <ClientServerConnection>();
                if (phoneConnection != null)
                {
                    GameObject character = phoneConnection.StartGame(parentCharacters, spawnPoint, rotationPoint, settings);

                    GameObject scoreUI = Instantiate(prefabPlayerScore, playerBoardUI);

                    PlayerManager pManager = character.GetComponent <PlayerManager>();
                    pManager.killsNeeded = killsNeeded;

                    PlayerUI uiPlayer = scoreUI.GetComponent <PlayerUI>();
                    uiPlayer.SetPlayer(pManager);
                    uiPlayer.ShowBells();
                }

                i++;
            }
        }

        // Switch menu clients
        Server.StartGame();

        // Show message
        StartCoroutine(ShowMessage());

        pickups.SearchForPlayers();

        if (FadeInOut.screen != null)
        {
            FadeInOut.screen.FadeIn();
        }
    }
 public void OnTaskComplete_NavWay()
 {
     if (Settings_Task_NavWay != null)
         Settings_Task_NavWay.Dispose();
     Settings_Task_NavWay = new SettingsLevel(Settings_Task_NavEngage);
 }
 public void OnTaskComplete_NavRot()
 {
     if (Settings_Task_NavRot != null)
         Settings_Task_NavRot.Dispose();
     Settings_Task_NavRot = new SettingsLevel(Settings_Commands);
     OnTaskComplete_NavMove();
 }
Exemple #15
0
 /// <summary>
 /// Creates a SettingLevel with a parent. Where values are not present, value from parent will be used.
 /// </summary>
 internal SettingsLevel(SettingsLevel parent)
 {
     this.parent = parent;
 }
			/// <summary>
			/// Creates a SettingLevel with a parent. Where values are not present, value from parent will be used.
			/// </summary>
			internal SettingsLevel(SettingsLevel parent)
			{ this.parent = parent; }
    public GameObject StartGame(Transform parentTransform, Vector3 spawnPoint, Quaternion spawnRotation, SettingsLevel settings)
    {
        GameObject behaviour = GameObject.Find("Behaviour");

        GameObject current = Instantiate(currentCharacter, spawnPoint, spawnRotation);

        current.transform.parent = parentTransform;
        character = current.GetComponent <BasicMovement>();

        character.spawnPoint    = spawnPoint;
        character.rotationPoint = spawnRotation;

        clr  = menuCharacter.clr;
        name = menuCharacter.name;
        character.SetBasics(name, clr);
        Debug.Log("Start with name " + name);

        settings.SetCharacter(name, currentCharacter.name);
        character.Settings(settings);

        return(current);
    }
 public void OnStartOfCommands()
 {
     if (Settings_Commands != null)
         Settings_Commands.Dispose();
     Settings_Commands = new SettingsLevel(defaultNavBlock);
     OnTaskComplete_NavRot();
 }