Exemple #1
0
    private void Start()
    {
        player = player == null?GameObject.FindGameObjectWithTag("Player") : player;

        if (player != null)
        {
            playerTag          = player.tag;
            playerInstance     = player.GetComponent <Player>();
            playerJumpInstance = player.GetComponent <PlayerJump2D>();
            //print(playerJumpInstance.JumpLevel);
        }
        else
        {
            bugState = true;
        }

        colComponent = GetComponent <BoxCollider2D>();
        srComponent  = GetComponent <SpriteRenderer>();
    }
    private void Awake()
    {
        string playerName = player.name;

        if (playerName == null)
        {
            Debug.Log("PlayerCollision - 플레이어를 찾지 못했습니다.");
        }
        else
        {
            pj = GameObject.Find(playerName).GetComponent <PlayerJump2D>();
            var playerInstance = GameObject.Find(playerName).GetComponent <Player>();
            InitJumpEvent += pj.JumpStateReset;
            if (playerInstance != null)
            {
                JumpLandingEvent     += playerInstance.LandingAnimation;
                ClearLimitStateEvent += playerInstance.ClearLimitState;
            }
        }
    }
 private void Start()
 {
     _playerJump2D = GetComponent <PlayerJump2D>();
 }