Exemple #1
0
    public void Init(bool isServer, Material material)
    {
        _isServer = isServer;

        var tankDisplay = Instantiate(_tankPrefab, transform.position, transform.rotation);

        tankDisplay.transform.SetParent(transform, true);

        _display  = tankDisplay.GetComponent <TankDisplay>();
        _movement = GetComponent <TankMovement>();
        _shooting = GetComponent <TankShooting>();
        Health    = GetComponent <TankHealth>();

        _movement.Init(isServer);
        _shooting.Init(_display);
        Health.Init(this, _display);
        _display.Init(_movement, material);
    }