private void FixGameObjectPosition(Collider2D col, bool triggerEnabled) { // Der Player darf nicht durch die Seitenwände springen if (col.gameObject.tag.Equals(EnemyAWConst.PLAYER)) { MyPlayerController cont = col.gameObject.GetComponent <MyPlayerController>(); cont.PlayerPolygonCollider.isTrigger = triggerEnabled; } if (LayerMask.LayerToName(col.gameObject.layer).Equals(EnemyAWConst.ENEMY)) { if (!col.gameObject.tag.Equals(EnemyAWConst.ENEMY_BOUNCING)) { EnemyMoveAutoScript cont = col.gameObject.GetComponent <EnemyMoveAutoScript>(); cont.EnemyTriggerCollider.isTrigger = triggerEnabled; } } }
void Awake() { myPlayerController = gameObject.GetComponent <MyPlayerController>(); }