Пример #1
0
    public override void Init()
    {
        sfxCtrl           = GetComponentInChildren <GeneralSoundController>();
        platfromColldier  = GetComponent <BoxCollider>();
        anim              = GetComponentInChildren <Animator>();
        meshRenderer      = GetComponentInChildren <MeshRenderer>();
        rangeCollider     = GetComponentInChildren <SphereCollider>();
        toleranceCtrl     = GetComponent <EnemyToleranceController>();
        rotationBehaviour = GetComponent <Rotation>();

        graphics = GetComponentInChildren <IGraphic>();
        if (toleranceCtrl != null)
        {
            toleranceCtrl.Init();
        }

        SetObjectState(true);
        graphics.ChangeTexture(TextureType.Default);
        Parasite += HandleParasite;
        LevelManager.OnPlayerDeath += HandleOnPlayerDeath;


        idleCommandsCtrl.Init();
        parasiteCommandCtrl.Init();

        idleCommandsCtrl.ToggleButton(false);
        parasiteCommandCtrl.ToggleButton(false);

        prevRotation       = 90;
        transform.rotation = Quaternion.Euler(new Vector3(0, 0, prevRotation));
    }
Пример #2
0
    private void HandleParasite(Player _player)
    {
        player = _player;
        PlatformManager.OnParasite(this);

        anim.SetTrigger("Parasite");

        toleranceCtrl.Setup();
        player.OnPlayerMaxHealth += HandlePlayerMaxHealth;

        graphics.ChangeTexture(TextureType.Parasite);

        rotationBehaviour.enabled = false;
        launchDirection           = transform.right;

        idleCommandsCtrl.ToggleButton(false);
        parasiteCommandCtrl.ToggleButton(true);

        tickCoroutine = StartCoroutine(Tick());
    }