示例#1
0
    public override void Init()
    {
        base.Init();

        spr = GetComponent <SpriteRenderer>();
        if (spr == null)
        {
            spr = GetComponentInChildren <SpriteRenderer>();
        }

        hubM = GetComponent <HurtboxManager>();
        hibM = GetComponent <HitboxManager>();
        ctr  = GetComponent <Controller2D>();

        frameTimer = 0;
        animTimer  = 0;

        //if (animations[0] != null)
        //    ChangeAnimation(animations[0]);

        if (frameAnimationsSO != null)
        {
            animations = frameAnimationsSO.frameAnimations;
            ChangeAnimation(animations[0]);
        }
    }
示例#2
0
 public void SetActiveZone(ZoneProperties zone)
 {
     this.activeZone     = zone;
     this.platformHitbox = zone.GetHitboxManagerForZone();
     if (is2D)
     {
         this.hitbox.center = new Vector3(this.hitbox.center.x, this.hitbox.center.y, zone.ZCenter + zone.ZMaxOffset);
     }
 }
示例#3
0
 private void Start()
 {
     hitboxManager   = GetComponent <HitboxManager>();
     rb              = GetComponent <Rigidbody2D>();
     rb.gravityScale = projectileSettings.gravityScale;
     animator        = GetComponent <Animator>();
     animator.runtimeAnimatorController = projectileSettings.animatorController;
     maxExistTime = projectileSettings.maxExistTime;
 }
示例#4
0
    protected void Awake()
    {
        fanim = GetComponent <FrameAnimator>();
        spr   = GetComponent <SpriteRenderer>();
        hibMn = GetComponent <HitboxManager>();
        col   = GetComponent <CircleCollider2D>();

        counter = 0;

        fanim.ChangeAnimation(fly_anim);
    }
 // Use this for initialization
 void Awake()
 {
     player        = GameObject.FindGameObjectWithTag("Player").transform;
     nav           = GetComponent <NavMeshAgent> ();
     rb            = GetComponent <Rigidbody> ();
     coll          = GetComponent <Collider> ();
     sr            = GetComponent <SpriteRenderer> ();
     animator      = GetComponent <Animator> ();
     hitboxManager = GetComponent <HitboxManager> ();
     collider      = GetComponent <BoxCollider> ();
     effectManager = GameObject.FindObjectOfType <EffectManager> ();
 }
 protected virtual void Initialize()
 {
     owner           = this.gameObject.transform.root.gameObject;
     ownerCharacter  = owner.GetComponent <ICharacter>();
     ownerDamageable = owner.GetComponent <IDamageable>();
     manager         = GetComponentInParent <HitboxManager>();
     hitbox          = GetComponent <Collider2D>();
     hitbox.enabled  = false;
     collisions      = new List <GameObject>();
     result          = new Collider2D[100];
     numResults      = 0;
 }
示例#7
0
    void Start()
    {
        equippedWeapon   = 0;
        defending        = false;
        descendingAttack = false;
        animating        = false;
        hooking          = false;
        rocketing        = false;

        pinsList = new GameObject[totalPins];

        anim          = GetComponent <Animator> ();
        movement      = GetComponent <PlayerMovement> ();
        hitboxManager = GetComponentInChildren <HitboxManager>();
    }
    // Gets player info for access
    void GetPlayerInfo()
    {
        player = GameObject.FindWithTag("Player");
        if (player == null)
        {
            return;
        }

        CameraControllerScript     = Camera.main.GetComponent <CameraController>();
        LedgeClimbControllerScript = player.GetComponent <LedgeClimbController>();
        PlayerControllerScript     = player.GetComponent <PlayerController>();
        ItemManagerScript          = player.GetComponent <ItemManager>();
        HealthScript        = player.GetComponent <Health>();
        HitboxManagerScript = player.GetComponent <HitboxManager>();
    }
示例#9
0
    void Start()
    {
        animator           = GetComponent <Animator>();
        controller         = GetComponent <CharacterController2D>();
        hitboxManager      = GetComponent <HitboxManager>();
        effectsAudioSource = GetComponent <AudioSource>();
        sceneTransitioner  = (SceneTransitioner)FindObjectOfType(typeof(SceneTransitioner));
        effectsCanvas      = (EffectsCanvas)FindObjectOfType(typeof(EffectsCanvas));

        cardManager = (CardManager)FindObjectOfType(typeof(CardManager));

        animationManager = new AnimationManager(animator, this);

        fsm = new FSM <Manfred, ManfredStates.IManfredState>(this);

        fsm.ChangeState(stateAirborne, stateAirborne, false);
    }
示例#10
0
    // Start is called before the first frame update
    void Start()
    {
        this.animator       = GetComponent <Animator>();
        this.hitboxManager  = GetComponent <HitboxManager>();
        this.spriteRenderer = GetComponent <SpriteRenderer>();
        this.impulseSource  = GetComponent <Cinemachine.CinemachineImpulseSource>();

        this.animationManager = new AnimationManager(animator, this);
        characterDetector.AddListener(this);

        this.defaultSpriteMaterial = spriteRenderer.material;
        this.bossRetreatThreshold  = this.health / 2;

        enemyManager = (EnemyManager)FindObjectOfType(typeof(EnemyManager));
        if (!isBoss)
        {
            enemyManager.IncrementTrashEnemies();
        }
        else
        {
            enemyManager.SetListener(this);
        }
    }
示例#11
0
 void Awake()
 {
     hitboxManager  = GetComponent <HitboxManager>();
     spriteRenderer = GetComponent <SpriteRenderer>();
     fireballPool   = FindObjectOfType <FireballPool>();
 }
示例#12
0
 // Use this for initialization
 protected void Start()
 {
     animator       = GetComponent <Animator> ();
     spriteRenderer = GetComponent <SpriteRenderer> ();
     hitboxManager  = GetComponent <HitboxManager> ();
 }
示例#13
0
 protected virtual void LateUpdate()
 {
     PhysicsManager.Tick(EHTime.DeltaTime);
     HitboxManager.Tick(EHTime.DeltaTime);
 }
示例#14
0
 // Use this for initialization
 void Start()
 {
     myManager = transform.root.gameObject.GetComponent <HitboxManager>();
 }
 private void Start()
 {
     parentChar    = GetComponent <Character>();
     charActions   = parentChar.charActions;
     hitboxManager = GetComponentInChildren <HitboxManager>();
 }
 private void Start()
 {
     parentProjectile = GetComponent <Projectile>();
     hitboxManager    = GetComponentInChildren <HitboxManager>();
 }