void Start() { manager = singleton_manager.get_sigleton(); rigid = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); last_position = transform.position; for (int i = 0; i < 3; i++) { tired[i] = 1; } if (player_1) { if (Random.value > 0.5f) { ability_power[0] = Random.Range(0.5f, 0.7f); ability_power[1] = Random.Range(0.3f, 0.5f); } else { ability_power[0] = Random.Range(0.3f, 0.5f); ability_power[1] = Random.Range(0.5f, 0.7f); } ability_power[2] = Random.Range(0.4f, 0.6f); } else { character_control p1_script = GameObject.Find("player_1").GetComponent <character_control>(); for (int i = 0; i < 3; i++) { ability_power[i] = 1 - p1_script.ability_power[i]; } } }
private void OnCollisionStay2D(Collision2D col) { if (!mutex && col.gameObject.tag == "player") { mutex = true; control_script = col.gameObject.GetComponent <character_control>(); if (col.transform.name == "player_1") { own_by_P1 = true; } else { own_by_P1 = false; } } }