Пример #1
0
    void Start()
    {
        action_    = GetComponent <SlimeActions>();
        animation_ = GetComponent <SlimeAnimation>();

        action_.addObserver(animation_);
        animation_.addObserver(action_);
    }
Пример #2
0
    public void Start()
    {
        health_ = initialHealth_;

        SlimeAnimation animation = GetComponent <SlimeAnimation>();

        animation.addObserver(this);

        rb2D_ = GetComponent <Rigidbody2D>();
    }
Пример #3
0
    void Start()
    {
        slimeActor_ = GetComponent <IGameActor>();
        SlimeActions actions = GetComponent <SlimeActions>();

        actions.addObserver(this);
        SlimeAnimation anim = GetComponent <SlimeAnimation>();

        anim.addObserver(this);

        player_ = GameObject.FindGameObjectWithTag("Player").transform;

        stateScore_ = new Dictionary <SlimeState, int>();
        foreach (SlimeState state in Enum.GetValues(typeof(SlimeState)))
        {
            stateScore_.Add(state, 0);
        }
    }