private void Awake() { ai = GetComponent <EnemyAI>(); rigid = GetComponent <Rigidbody2D>(); slimeAnim = GetComponent <SlimeAnimation>(); boxCollider2D = GetComponent <BoxCollider2D>(); }
void Start() { action_ = GetComponent <SlimeActions>(); animation_ = GetComponent <SlimeAnimation>(); action_.addObserver(animation_); animation_.addObserver(action_); }
public void Start() { health_ = initialHealth_; SlimeAnimation animation = GetComponent <SlimeAnimation>(); animation.addObserver(this); rb2D_ = GetComponent <Rigidbody2D>(); }
private void initAnimation(List <Subtexture> subtexture) { animation = addComponent(new Sprite <SlimeAnimation>(subtexture[3])); animation.addAnimation(SlimeAnimation.Idle, new SpriteAnimation(subtexture[3])); animation.addAnimation(SlimeAnimation.Move, new SpriteAnimation(new List <Subtexture>() { subtexture[0], subtexture[1], subtexture[2], subtexture[3], subtexture[4], subtexture[5], subtexture[6], subtexture[7], })); currentAnimation = SlimeAnimation.Idle; }
private void Start() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Color color = meshRenderer.get_material().get_color(); color.a = 0f; meshRenderer.get_material().set_color(color); SetInvisible(); parametricPlane = this.GetComponent <ParametricPlane>(); parametricPlane.CreateMesh(); Initialize(); slimeAnim = new SlimeAnimation(this); isMeshUpdate = false; }
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); } }
public override void update() { if (couldPause && GameSetting.isGamePause) { return; } preAnimation = currentAnimation; base.update(); if (moveDir != Vector2.Zero) { currentAnimation = SlimeAnimation.Move; } else { currentAnimation = SlimeAnimation.Idle; } if (currentAnimation != preAnimation) { changeAnimeion(currentAnimation); } }
private void changeAnimeion(SlimeAnimation animation) { currentAnimation = animation; this.animation.play(currentAnimation); }
private void Awake() { boxCollider2D = GetComponent <BoxCollider2D>(); rigid = GetComponent <Rigidbody2D>(); anim = GetComponent <SlimeAnimation>(); }