Пример #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player" && collision.name != owner_cs.PlayerName_Data)
        {
            bool InstantDeath = false;

            //ランダムで同じ数字が出たら即死
            for (int i = 0; i < InstantDeathNamber.Length; i++)
            {
                int test = Random.Range(1, 100);
                if (InstantDeathNamber[i] == test)
                {
                    InstantDeath = true;

                    //エフェクトの発生
                    GameObject EffectObj = Instantiate(InstatDeath_Effect) as GameObject;
                    // エフェクトの発生場所をプレイヤーの中心に
                    EffectObj.transform.position = new Vector3(this.transform.position.x, this.transform.position.y, 0);

                    //エフェクト発生を待って破棄する
                    StartCoroutine(this.DelayMethod(2.0f, () => { Destroy(EffectObj); }));

                    break;
                }
            }

            if (InstantDeath == false)
            {
                EffectOccurrence(new Vector3(this.transform.position.x, this.transform.position.y, 0), Vector3.zero);
            }

            PSManager_cs.Player_Damage(collision.gameObject, this.gameObject, collision.GetComponent <Player>().PlayerNumber_data, InstantDeath);
        }
    }
Пример #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player" && collision.name != owner_cs.PlayerName_Data)
     {
         base.EffectOccurrence_World(this.transform.position + new Vector3(0.2f, 0.0f, 0.0f), Vector3.zero);
         PSManager_cs.Player_Damage(collision.gameObject, this.gameObject, collision.transform.GetComponent <Player>().PlayerNumber_data);
     }
 }
Пример #3
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player" && collision.name != owner_cs.PlayerName_Data)
        {
            //プレイヤーにダメージを与える
            PSManager_cs.Player_Damage(collision.gameObject, this.gameObject, collision.transform.GetComponent <Player>().PlayerNumber_data);

            base.EffectOccurrence(this.transform.GetChild(0).position, Vector3.zero);
        }
    }
Пример #4
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player" && collision.name != owner_cs.PlayerName_Data)
        {
            PSManager_cs.Player_Damage(collision.gameObject, this.gameObject, collision.transform.GetComponent <Player>().PlayerNumber_data);

            if (SRenderer.flipX == false)
            {
                base.EffectOccurrence(this.transform.position + new Vector3(1, 0, 0), Vector3.zero);
            }
            else
            {
                base.EffectOccurrence(this.transform.position + new Vector3(-1, 0, 0), new Vector3(-180, 0, 0));
            }
        }
    }