示例#1
0
        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;
                }
            }
        }
示例#2
0
 void Awake()
 {
     myPlayerController = gameObject.GetComponent <MyPlayerController>();
 }