Exemple #1
0
    private void Awake()
    {
        agentCreature = GetComponent <Agent>();
        //_gauges.InitializeGauges(_traits);
        //stomachValue = Gauges.Hunger;
        //_lifeNumber = maxLifeNumber;

        //reproductionValue = maxReproductionValue;

        CreatureDoing            = new CreatureDoing(this);
        CreatureDoing.myCreature = this;

        DNADistortion = new DNADistortion();

        Renderer rend = Body.GetComponent <Renderer>();

        BodyShader = Body.GetComponent <MignonBody>();

        FaceSwap  = new FaceSwap(rend);
        ColorSwap = new ColorSwap(bodyRenderer, hearLeftRenderer, hearRightRenderer, tailRenderer, shadowRenderer);

        AudioBox = GetComponent <AudioBox>();

        /*if(!isGaugesSubscribed){
         *  _gauges.Life.Depleted -= Die;
         *  _gauges.Hunger.Depleted -= Die;
         * }*/
    }
Exemple #2
0
    public void Die(bool withEffect = true)
    {
        if (withEffect)
        {
            PlayDieEffect();
        }

        DNADistortion.DestroyAllParticularities();

        isDying = true;
        if (agentCreature.IsThinking)
        {
            agentCreature.Perception.RevisionView.RemoveAllEvent();
        }
        //
        CreatureDoing.StopCommunicate();
        //
        CreatureDie?.Invoke(this);
        //Destroy(gameObject);
        CreatureFactory.Instance?.DestroyCreature(this);
    }