Esempio n. 1
0
        private BaseSpawnPoint GetSpawnPoint(out Vector3 pos, out Quaternion rot)
        {
            BaseSpawnPoint spawnPoints = null;

            pos = Vector3.zero;
            rot = Quaternion.identity;
            int num = UnityEngine.Random.Range(0, (int)this.SpawnPoints.Length);

            for (int i = 0; i < (int)this.SpawnPoints.Length; i++)
            {
                spawnPoints = this.SpawnPoints[(num + i) % (int)this.SpawnPoints.Length];
                if (spawnPoints && spawnPoints.gameObject.activeSelf)
                {
                    break;
                }
            }
            if (spawnPoints)
            {
                spawnPoints.GetLocation(out pos, out rot);
            }
            return(spawnPoints);
        }
Esempio n. 2
0
    protected virtual BaseSpawnPoint GetSpawnPoint(out Vector3 pos, out Quaternion rot)
    {
        BaseSpawnPoint baseSpawnPoint = (BaseSpawnPoint)null;

        pos = Vector3.get_zero();
        rot = Quaternion.get_identity();
        int num = Random.Range(0, this.spawnPoints.Length);

        for (int index = 0; index < this.spawnPoints.Length; ++index)
        {
            baseSpawnPoint = this.spawnPoints[(num + index) % this.spawnPoints.Length];
            if (Object.op_Implicit((Object)baseSpawnPoint) && ((Component)baseSpawnPoint).get_gameObject().get_activeSelf())
            {
                break;
            }
        }
        if (Object.op_Implicit((Object)baseSpawnPoint))
        {
            baseSpawnPoint.GetLocation(out pos, out rot);
        }
        return(baseSpawnPoint);
    }
    protected virtual BaseSpawnPoint GetSpawnPoint(out Vector3 pos, out Quaternion rot)
    {
        BaseSpawnPoint baseSpawnPoint = null;

        pos = Vector3.zero;
        rot = Quaternion.identity;
        int num = UnityEngine.Random.Range(0, (int)this.spawnPoints.Length);

        for (int i = 0; i < (int)this.spawnPoints.Length; i++)
        {
            baseSpawnPoint = this.spawnPoints[(num + i) % (int)this.spawnPoints.Length];
            if (baseSpawnPoint && baseSpawnPoint.gameObject.activeSelf)
            {
                break;
            }
        }
        if (baseSpawnPoint)
        {
            baseSpawnPoint.GetLocation(out pos, out rot);
        }
        return(baseSpawnPoint);
    }