public override void OnInspectorGUI() { base.OnInspectorGUI(); // DestructableObject sc = (DestructableObject)target; // if (GUILayout.Button("Destroy")) { sc.SetShatter(); } }
// public void Dead(string tag, Collider2D col = null) { if (isDead || isInvincible) { return; } // switch (shieldState) { case ShieldEffect.ShieldState.NONE: break; case ShieldEffect.ShieldState.NORMAL: { if ((tag != "Concrete") && (tag != "Crash")) { ActiveShield(); return; } } break; case ShieldEffect.ShieldState.ACTIVE: { if ((tag != "Concrete") && (tag != "Crash")) { return; } } break; default: break; } // // Dead Sequance //Debug.Log("Player Dead By [" + tag + "]"); isDead = true; GameManager.instance.gameOver = true; // SceneControl.instance.SaveRecord(); // Shatter Effect GameObject obj = Instantiate(dummyDestroy, transform.position, Quaternion.identity); DestructableObject dd = obj.GetComponent <DestructableObject>(); dd.Flip(sr.flipX); if (col != null) { Vector3 dir = col.transform.position - tf.position; switch (tag) { case "Explosion": break; case "Thunder": { float x = dir.x >= 0 ? 7.0f : -7.0f; dir.x = x; dir.y = 0; } break; case "Laser": { float y = dir.y >= 0 ? 7.0f : -7.0f; dir.x = 0; dir.y = y * 2.0f; } break; case "Crash": { dir.x = 0; dir.y = -20.0f; } break; default: break; } Vector3 spcPos = tf.position + dir; dd.spc.transform.position = spcPos; } dd.SetShatter(); SoundManager.instance.Play(SoundKey.DEAD); gameObject.SetActive(false); // GameManager.instance.ReloadPlayScene(); }