Пример #1
0
    /// <summary>
    /// Instantiate the splitting enemies at their splitting position
    /// CALL IN ANIMATION
    /// </summary>
    private void SplitSiamese()
    {
        if (!PhotonNetwork.isMasterClient)
        {
            return;
        }
        List <TDS_Enemy> _spawnedEnemies = new List <TDS_Enemy>();
        TDS_Enemy        _e = null;

        for (int i = 0; i < splitingEnemiesNames.Length; i++)
        {
            _e = PhotonNetwork.Instantiate(splitingEnemiesNames[i], transform.position + splitingPosition[i], Quaternion.identity, 0).GetComponent <TDS_Enemy>();
            if (_e != null)
            {
                if (Area)
                {
                    Area.AddEnemy(_e);
                }
                _spawnedEnemies.Add(_e);
            }
        }
        TDS_UIManager.Instance.SetBossLifeBar(_spawnedEnemies.ToArray(), splittingPortrait);
        if (Area)
        {
            Area.RemoveEnemy(this);
        }
        PhotonNetwork.Destroy(this.gameObject);
    }