//他オブジェクトが触れている間 void OnTriggerStay2D(Collider2D col) { if (col.gameObject.tag == "Electrical") { Script = col.gameObject.GetComponent <ElectricScript>(); ElekTime = Script.ElekTime; //となりの電気の強さをコピーする } }
//他オブジェクトが触れている間 void OnTriggerStay2D(Collider2D col) { if (col.gameObject.tag == "Electrical") { //Debug.Log("Test!!!!!!!!"); Script = col.gameObject.GetComponent <ElectricScript>(); if (Script.ElekTime > 0 && !Minamoto) { ElekTime = Script.ElekTime; //となりの電気の強さをコピーする } } }