public void SetNewPos(bool movedForward) { switch (currentPos) { case ScenaryManager.Position.Wayfront: currentPos = movedForward ? ScenaryManager.Position.Front : ScenaryManager.Position.Wayfront; break; case ScenaryManager.Position.Front: currentPos = movedForward ? ScenaryManager.Position.Middle : ScenaryManager.Position.Wayfront; break; case ScenaryManager.Position.Middle: currentPos = movedForward ? ScenaryManager.Position.Back : ScenaryManager.Position.Front; break; case ScenaryManager.Position.Back: currentPos = movedForward ? ScenaryManager.Position.Wayback : ScenaryManager.Position.Middle; break; case ScenaryManager.Position.Wayback: currentPos = movedForward ? ScenaryManager.Position.Wayback : ScenaryManager.Position.Back; break; } obj.GetComponent <EdgeCollider2D>().enabled = currentPos == ScenaryManager.Position.Middle; currentPosV3 = obj.position; SetOtherPos(); }
public PositionInfo(Transform _obj, ScenaryManager.Position _pos) { obj = _obj; currentPos = _pos; currentPosV3 = obj.position; SetOtherPos(); }