示例#1
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        Playar temp = collision.transform?.GetComponent <Playar>();

        if (temp != null)
        {
            temp.StartBigPlayar();
            Destroy(gameObject);
        }
    }
示例#2
0
    private void Start()
    {
        for (int i = 0; i < EnemyNumber; i++)
        {
            CreateEnemy(EnemyArrey[Random.Range(0, EnemyArrey.Length)]);
        }

        player = FindObjectOfType <Playar>();

        player.SetEnemyList(EnemyList);
    }
示例#3
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        Playar temp = collision.transform?.GetComponent <Playar>();

        if (temp != null)
        {
            temp.StarSuperPlayar();
            Destroy(gameObject);
        }
        else
        {
            _rigetbody.AddForce(Vector2.up * jumpFors, ForceMode2D.Impulse);
        }
    }
示例#4
0
    private void Start()
    {
        player = FindObjectOfType <Playar>();

        if (player != null)
        {
            FullHipPoint          = player.GetHitPoint();
            player.UpdateHpEvent += UpdateHitBar;
            player.UpdateHpEvent += UpdateText;
        }
        else
        {
            Debug.Log("From HitPointBar: Playar is not faund");
        }

        HitPointText.text = FullHipPoint.ToString();
    }
示例#5
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Playar temp = collision?.GetComponent <Playar>();

        if (temp != null)
        {
            if (temp.EatMashrim == false)
            {
                temp.StartBigPlayar();
            }
            else
            {
                temp.StartFlowerPlayar();
            }

            Destroy(gameObject);
        }
    }