Ejemplo n.º 1
0
    void Awake()
    {
        unitId = GetComponent<Unit_ID>();

        if (!isServer)
        {
            return;
        }
    }
Ejemplo n.º 2
0
    void Awake()
    {
        unitId = GetComponent <Unit_ID>();

        if (!isServer)
        {
            return;
        }
    }
Ejemplo n.º 3
0
    public override void OnStartServer()
    {
        _destructible = GetComponent <Destructible>();
        navAgent      = GetComponent <NavMeshAgent>();
        _unit_ID      = GetComponent <Unit_ID>();
        _destructible.CmdSetMaxLife(minionsInformations.baseLifePoints);

        _destructible.HandleDestroyed += OnDie;
        _destructible.HandleAlive     += OnAlive;
    }
Ejemplo n.º 4
0
    public static GameObject GetPlayerNumberNext(Unit_ID playerInit, int numberToIncrement)
    {
        // Avoid overlaping yourself
        numberToIncrement = Mathf.Clamp(numberToIncrement, 0, GameSharedData.NumberOfPlayer - 1);

        int pos = 0;
        // Find your position in the table
        foreach (var v in GetAllPlayers)
        {
            if (v.GetComponent<Unit_ID>().GetPlayerIndex() == playerInit.GetPlayerIndex())
            {
                break;
            }
            pos++;
        }

        int playerId = (pos + numberToIncrement) % (GameSharedData.NumberOfPlayer);


        return GetAllPlayers[playerId];
    }
Ejemplo n.º 5
0
    public static GameObject GetLocalPlayer()
    {
        GameObject tofind;

        if (Camera.main.transform.position.x > 0 && Camera.main.transform.position.z > 0)
        {
            tofind = Unit_ID.FindPlayer(2);
        }
        else if (Camera.main.transform.position.x < 0 && Camera.main.transform.position.z > 0)
        {
            tofind = Unit_ID.FindPlayer(3);
        }
        else if (Camera.main.transform.position.x > 0 && Camera.main.transform.position.z < 0)
        {
            tofind = Unit_ID.FindPlayer(1);
        }
        else //if (Camera.main.transform.position.x < 0 && Camera.main.transform.position.y < 0)
        {
            tofind = Unit_ID.FindPlayer(4);
        }

        return(tofind);

        /*
         * if (localPlayer)
         * {
         *  return localPlayer;
         * }
         *
         * foreach (GameObject player in GameSharedData.GetAllPlayers)
         * {
         *  if (player.GetComponent<PlayerNetwork>().connectionId == LANLobbyNetworkManager.singleton.client.connection.connectionId)
         *  {
         *      localPlayer = player;
         *  }
         * }
         *
         * return localPlayer;*/
    }
Ejemplo n.º 6
0
    public static GameObject GetPlayerNumberNext(Unit_ID playerInit, int numberToIncrement)
    {
        // Avoid overlaping yourself
        numberToIncrement = Mathf.Clamp(numberToIncrement, 0, GameSharedData.NumberOfPlayer - 1);

        int pos = 0;

        // Find your position in the table
        foreach (var v in GetAllPlayers)
        {
            if (v.GetComponent <Unit_ID>().GetPlayerIndex() == playerInit.GetPlayerIndex())
            {
                break;
            }
            pos++;
        }

        int playerId = (pos + numberToIncrement) % (GameSharedData.NumberOfPlayer);


        return(GetAllPlayers[playerId]);
    }
Ejemplo n.º 7
0
    void Awake()
    {
        _unit_ID = GetComponent <Unit_ID>();

        minionSoundControler = GetComponent <SoundableMinion>();
    }
Ejemplo n.º 8
0
	void Awake () 
    {
	   DontDestroyOnLoad(gameObject);
       _unitID = GetComponent<Unit_ID>();
	}
Ejemplo n.º 9
0
 public void CmdSpawnUnit(MinionType _typeToSpawn)
 {
     Unit_ID.FindPlayer(_unit_ID.GetPlayerIndex()).GetComponent <SpawnerController>().spawnedCharacter = _typeToSpawn;
 }
Ejemplo n.º 10
0
 void Start()
 {
     _unit_ID = GetComponent <Unit_ID>();
 }
Ejemplo n.º 11
0
 void Start()
 {
     _playerNetwork = GetComponent<PlayerNetwork>();
     _unitID = GetComponent<Unit_ID>();
 }
Ejemplo n.º 12
0
 void Start()
 {
     _playerNetwork = GetComponent <PlayerNetwork>();
     _unitID        = GetComponent <Unit_ID>();
 }
Ejemplo n.º 13
0
 // Use this for initialization
 void OnEnable () {
     _unitId = GetComponent<Unit_ID>();
     Invoke("FirstSpawn", spawnerInformations.TimeBeforeFirstLaunch + 1);
 }
Ejemplo n.º 14
0
    public override void OnStartServer()
    {
        _destructible = GetComponent<Destructible>();
        navAgent = GetComponent<NavMeshAgent>();
        _unit_ID = GetComponent<Unit_ID>();
        _destructible.CmdSetMaxLife(minionsInformations.baseLifePoints);

        _destructible.HandleDestroyed += OnDie;
        _destructible.HandleAlive += OnAlive;
    }
Ejemplo n.º 15
0
    void Awake()
    {
        _unit_ID = GetComponent<Unit_ID>();

        minionSoundControler = GetComponent<SoundableMinion>();
    }
Ejemplo n.º 16
0
 // Use this for initialization
 void OnEnable()
 {
     _unitId = GetComponent <Unit_ID>();
     Invoke("FirstSpawn", spawnerInformations.TimeBeforeFirstLaunch + 1);
 }
Ejemplo n.º 17
0
 void Awake()
 {
     DontDestroyOnLoad(gameObject);
     _unitID = GetComponent <Unit_ID>();
 }
Ejemplo n.º 18
0
 void Start()
 {
     _unit_ID = GetComponent<Unit_ID>();
 }