void Awake()
 {
     _player = GetComponent<Player> ();
     _aiPlayer = GetComponent<AIPlayer> ();
     _aiMovement = GetComponent<AIMovement> ();
     _movement = GetComponent<PlatformerMovement> ();
 }
 void Awake()
 {
     moveTarget = new Vector2(transform.position.x,transform.position.y);
     _aiPlayer = GetComponent<AIPlayer> ();
     _platformMovement = gameObject.GetComponent<PlatformerMovement> ();
     _prePos = transform.position;
 }
Beispiel #3
0
 public void AssignActivePlayer(PlatformerMovement targetPlayer)
 {
     activePlayer = targetPlayer;
     transform.SetParent(activePlayer.transform.Find(ContainerBase));
     transform.localPosition = idPoint;
     transform.rotation      = targetPlayer.transform.rotation;
     TriggerArea.enabled     = false;
     GetComponent <Animator>().SetFloat("ALspeed", 0.5f);
 }
Beispiel #4
0
 // Start is called before the first frame update
 void Start()
 {
     sceneSwitcher   = GameObject.Find("SceneSwitcher").GetComponent <SceneSwitching>();
     blackFade.color = new Color(blackFade.color.r, blackFade.color.g, blackFade.color.b, 1f);
     fadeOutTime     = 0.5f;
     StartCoroutine("SceneFadeIn");
     player1Movement = GameObject.Find("Player1").GetComponent <PlatformerMovement>();
     player2Movement = GameObject.Find("Player2").GetComponent <PlatformerMovement>();
 }
    void Awake()
    {
        this.transform.tag = Tags.PLAYER;

        _myPlatformerMovement = gameObject.AddComponent<PlatformerMovement>();

        _attackCatcher = gameObject.AddComponent<AttackCather> ();
        _clashAble = gameObject.AddComponent<ClashAble> ();
        _basicAttack = gameObject.AddComponent<BasicStunAttack> ();
        _playerTransformer = gameObject.AddComponent<PlayerTransformer> ();
        gameObject.AddComponent<TouchDetector2D> ();
        gameObject.AddComponent<LandOnTopKill> ();
        rigidBody = gameObject.GetComponent<Rigidbody2D> ();
        _playerAnimHandler = gameObject.AddComponent<PlayerAnimationHandler> ();
        gameObject.AddComponent<RigidbodyUtil2D>();

        _fader = gameObject.AddComponent<FadeInOut> ();

        gameObject.AddComponent<PlayerEffects>();
        gameObject.AddComponent<PlayerSoundHandler>();

        _stunTimer = gameObject.AddComponent<ComTimer> ();

        _stunTimer.TimerEnded += StunTimerEnded;

        _attackCatcher.OnStunAttackCatch += OnStunHit;
        _attackCatcher.OnStunKillAttackCatch += OnStunKillHit; // if Jump on my head hit while in stun
        _attackCatcher.OnKillAttackCatch += OnKillHit;
    }